September 13, 2007 at 12:22 am
Hi friends,
I have a text file having three columns with values. Using Bulk Insert i need to skip the 2nd column values while doing the bulk insert and work with the 1st and 3rd column. This is my project requirement. Pls help me. It is very urgent.
Thanx
CRPRAJAN
September 13, 2007 at 5:36 am
Then, you can do one of two things...
1. Import to a 3 column staging table (where you can also validate the data before making it live, good safeguard) and transfer from that... or...
2. Make a BCP format file... Books Online explains how to do that quite nicely.
--Jeff Moden
Change is inevitable... Change for the better is not.
September 30, 2007 at 10:26 am
see
http://www.nigelrivett.net/SQLTsql/BCP_quoted_CSV_Format_file.html
Cursors never.
DTS - only when needed and never to control.
October 1, 2007 at 2:06 pm
crprajan,
Both Jeff and nigelrivett, have valid approaches. There is also a last option of using DTS/SSIS to transform the data from the flat file to the destination table. Even for this option, I would recommend using a staging table, and then copy the imported data from the staging table to the actual destination table.
Regards,
Wameng Vang
MCTS
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply