stevet26
Programmer
- Feb 9, 2005
- 53
Hi
A project I am working on right now requires me to write a piece of code which imports the data from a CSV file into a SQL server Database.
Now, the way I see it I have one of two options.
1. I loop through each row of the CSV file and have an insert statement for each one.
2. I loop through each row of the CSV file and build up a data table. Then, once built, I some how insert the contents of the data table into the corresponding table in the SQL server Database.
The second option would be the most effective but I am not sure of how to go about or if it is even possible.
Can anyone tell me if I am on the right tacks and if so point me in the direction of a page which can help me in my quest.
Thanking you all in advance.
A project I am working on right now requires me to write a piece of code which imports the data from a CSV file into a SQL server Database.
Now, the way I see it I have one of two options.
1. I loop through each row of the CSV file and have an insert statement for each one.
2. I loop through each row of the CSV file and build up a data table. Then, once built, I some how insert the contents of the data table into the corresponding table in the SQL server Database.
The second option would be the most effective but I am not sure of how to go about or if it is even possible.
Can anyone tell me if I am on the right tacks and if so point me in the direction of a page which can help me in my quest.
Thanking you all in advance.