Null field in destination table
Hi all, I am just getting started with SSIS and I have a newbie questions... I have a table in database A with 23 fields in it, I want to populate a table in database B with it 24 fields in it from the table in database A. However, the extra field is non-nullable. How can I add an empty string to this field? Thanks in advance
October 9th, 2012 9:07am

Hi, You can do any of these In the DFT before destination, you can drag and drop a derived column transformation, Add a column set blank value to it, and map it in the destination to the 24th field. Refer this.If you are picking the data from source using a query, you can add ,"" as 24thfield in the select statement.You can set a default value to the column if the value is not passed. It is a table structure change, not a SSIS change. See this. Rajkumar
Free Windows Admin Tool Kit Click here and download it now
October 9th, 2012 9:14am

Modify your source sql query to include a dummy column initialised with empty string. Something like; Select Col1, Col2,..., '' as ColA from SourceTable and then map ColA to the destination column. If you can't do that then add a new column using a derived column tranformation and initialise it with an empty string. Something like; http://btsbee.wordpress.com/
October 9th, 2012 9:15am

Excellent, Thanks... I will give option 1 a try as I am not using a query (yet) and the destination table cannot be modified.
Free Windows Admin Tool Kit Click here and download it now
October 9th, 2012 9:16am

Thanks guys, that worked, the only caveat was I needed to change from unicode to string as the destination was non-unicode. Thanks Again!
October 9th, 2012 9:25am

Can you mark the thread answered, if your query is answered?Rajkumar
Free Windows Admin Tool Kit Click here and download it now
October 9th, 2012 9:28am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics