5 pts.
 Can I do create dynamic table while bulk insert ?
Hi, I am Software Engineer, I am using SQL-SERVER, I have a issue with it. I want to write a query to dynamically create a table when using BULK Insert. No of Column is dependent upon no of fields available in first row. Assume that in each row no of column is same.Column name can be any string, like col(0),col1,col2..... etc. Is it possible in SQL. I have a lots of file which have no of columns different. So i need this query which help to to upload data very fast, without creating prior table. Waiting for Expert Reply, My No : 91-9911693850 India Delhi. arunkumar112@gmail.com arun_kumar112@yahoo.co.in Thanks,

Software/Hardware used:
ASKED: August 18, 2008  4:58 PM
UPDATED: September 22, 2008  11:08 AM

Answer Wiki:
The BULK INSERT command requires that the table exist beforehand. One option you can try would be to create a linked server to a file and do a SELECT INTO command which can create the columns on the fly. Then drop the linked server, and move on to the next file.
Last Wiki Answer Submitted:  August 19, 2008  3:06 pm  by  Denny Cherry   64,520 pts.
All Answer Wiki Contributors:  Denny Cherry   64,520 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Check out my SQL Server blog “SQL Server with Mr Denny” for more SQL Server information.

 64,520 pts.

 

Great. Thanks!

 0 pts.