January 20, 2010 at 6:05 am
Hi Guys,
Just wondering if Bulk Insert has the capability to specify columns on which the data are to be inserted in an import file? Any thoughts?
Thanks!
January 20, 2010 at 6:12 am
If I understood your question correctly, you can use a format file in order to insert data from a file that has different number of values then the table’s columns or has the data in a different order then the table’s columns. If this is what you are looking for, then you can read about format file in BOL (Books On Line the help that is installed with the client tools).
Adi
--------------------------------------------------------------
To know how to ask questions and increase the chances of getting asnwers:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
January 20, 2010 at 10:35 pm
You can also use a pass through view with the columns in the correct order.
--Jeff Moden
Change is inevitable... Change for the better is not.
January 21, 2010 at 12:44 am
Thanks Adi and Jeff for the prompt response. Will look/research into these suggestions you posted.
James
January 21, 2010 at 10:11 am
Jeff Moden (1/20/2010)
You can also use a pass through view with the columns in the correct order.
This will work on most cases, but in case that the file has more columns then the table, you have to use a format file.
Adi
--------------------------------------------------------------
To know how to ask questions and increase the chances of getting asnwers:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
February 5, 2010 at 4:50 pm
Ah... thanks for the reminder, Adi. I flat forgot about that.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply