Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SSIS and Import/Export (2008)
 Replace any string values from numeric column

Author  Topic 

learntsql

524 Posts

Posted - 2012-03-06 : 07:21:16
Hi All,

I am loading data from excel to sql server table.
In Excel sheet in the numeric columns client sime times sending some string/char data.
while loading in ssis how to replace any string data with null/zero.
Please guide me.
TIA

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2012-03-06 : 07:56:25
The only workaround I have found is to format the column in the Excel sheet as text and save the file, and then do the import to SQL.

And, of course, the destination column in the SQL table has to be character type if you do want the characters to be stored.

Edit: I was importing using import/export wizard. If you are using SSIS, are you able to set the data type properties on both sides, and would that fix it?
Go to Top of Page

yosiasz
Master Smack Fu Yak Hacker

1635 Posts

Posted - 2012-03-08 : 16:50:03
so if you want it to be null why in the world are you bringing it in the first place. Disregard that column and it will always be what you want it to be

<><><><><><><><><><><><><><><><><>
If you don't have the passion to help people, you have no passion
Go to Top of Page
   

- Advertisement -