April 23, 2012 at 4:47 am
Your solution is to either don't use Bulk Insert (use SSIS and trim the data on import) or import the data into a staging table, trim the spaces off, then insert it to its final destination.
Bulk Insert is not a command that is meant for data fiddling. It just inserts the data in the file. That's it. So far as I know, not even a format file will assist you because it's just looking for columns of different datatypes, different column order, or different # of columns.
April 23, 2012 at 4:51 am
its a shame because it works very fast.
thanks
April 23, 2012 at 5:16 am
eddy-961438 (4/23/2012)
its a shame because it works very fast.
That's why the command works so fast, because it's not transforming data.
April 23, 2012 at 5:58 am
Try to drop and recreate destination table with SET ANSI_PADDING OFF, it's still supported in SQL 2012
April 23, 2012 at 6:10 am
Eugene Elutin (4/23/2012)
Try to drop and recreate destination table with SET ANSI_PADDING OFF, it's still supported in SQL 2012
Note to OP: If you have data in this table and want to follow this advice, you need to archive it off somewhere so you won't lose it. Never drop a table without first double-checking that you can lose something without consequence.
Viewing 5 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply