Search This Blog

Thursday, November 17, 2011

SQL Server:How to import comma delimited or CSV file into table?

Load CSV file in sql server 2005/2008 using bulk insert 
This a very common question asked by the developer .
How to load CSV file into SQL Server Database Table? How to load comma delimited file into SQL Server?
Here I am giving you the step for that 


step1
create a table  as per your need
























step2
create your csv file from where you want to import or load data into your table
and save it on some path like c:\employee.csv






















step3
now use the following sql command in query analyzer
BULK
INSERT employee

FROM 'c:\employee.csv'WITH(FIELDTERMINATOR ',',ROWTERMINATOR '\n')GO




hope this help you a lot







No comments :

Post a Comment