Loading data via BCP when there are missing columns in text file

Hi,
I have number of tables with NULL column values allowed within them.

I have data files which I need to import into these tables using BCP. As expected, BCP needs matching columns with text data and surely not the case here.

I can see suggestion of using format file but it's not working for me.

I don't want to hand edit tonnes of files.I need to know if there is an easy way to create format files  using  BCP switches or any other alternative?

Thanks
crazywolf2010Asked:
Who is Participating?
 
DBAduck - Ben MillerConnect With a Mentor Principal ConsultantCommented:
You should look at the format file for bcp.

http://msdn.microsoft.com/en-us/library/ms191479.aspx

Look at the section that tells you about column order.  You can map the field 4 in the file to field 6 in the table.

And here is the reference for skipping the field in the table with the format file.

http://msdn.microsoft.com/en-us/library/ms179250.aspx
0
 
crazywolf2010Author Commented:
Hi,
Do I have to hand code each of the fmt file?


Thanks
0
All Courses

From novice to tech pro — start learning today.