Cant import data-2 different csv files

  • Hi Guys

    Is it possible to take a table and force an import of intermittent NULL values? then run a script aftewards to clean it up?

    The problem is a bit more complex than this so i just used the above as an example.

    Thanks in advance

    Andre

  • How are you importing the data? If you use SSIS, you can set a value in place of the NULLs on the way through and not even worry about cleanup later.

  • Two general way to approach this.

    If you are using SSIS you can as the previous poster suggested do all of your transform logic in the package and insert your data into the the destination table in its final state.

    Alternatively you can use the staging table approach. The staging table might allow nulls in all fields and use varchar datatypes and you would import you data 'as is'. Then you can analyze the data in the staging table, apply any logic, test the conversion to numeric, etc. Then insert the data from you staging table into the final destination table.

    To answer your question if you table does not allow nulls in a field then your insert would fail.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply