Introduction:
In this article,i am going to explain about how to import the CSV data into SQL table.
Main:
Bulk Insert Option allows you to insert bulk data’s into sql server table.
For more info about Bulk Insert please visit here,
For ex,
BULK INSERT EMP
FROM 'c:\EMPDetails.csv' -- Full path of the CSV file
WITH
(
FIELDTERMINATOR = ',', --CSV field delimiter
ROWTERMINATOR = '\n' --Use to shift the control to next row
)
select * from EMP;
BULK INSERT EMP FROM 'c:\EMPDetails.csv' -- Full path of the CSV file WITH ( FIELDTERMINATOR = ',', --CSV field delimiter ROWTERMINATOR = '\n' --Use to shift the control to next row ) select * from EMP; |
Conclusion:
Hope this helps,
Happy Coding.
I have to state, you chose your words well. The ideas you wrote on your encounters are well placed. This is an incredible blog!
This is my first time I have visited your site. I found a lot of interesting stuff in your blog. From the volume of comments on your articles, I guess I am not the only one! keep up the impressive work.
I have discovered and learned much from your blog. Your blog is really good.
Hold yourself responsible for a higher standard than anyone else expects of you. Never excuse yourself. Thank You. . . .