Friday, 26 June 2015

Import data from csv file to table in via SQL



Import data from csv file to table in via SQL



CREATE TABLE #Demotable(  
 [EmpName] [nvarchar](MAX) NULL,  

 [Email] [nvarchar](MAX) NULL
)


BULK INSERT #Demotable FROM 'C:\demo.csv' WITH (FIELDTERMINATOR = ',',ROWTERMINATOR = ' ')


Make sure csv and table have same fields.

1 comment:

  1. I would like to say thank you for the amazing details and concepts you are sharing in this.The style of writing is excellent and also the content is top-notch.




    Dot Net Training in Chennai | Dot Net Training in anna nagar | Dot Net Training in omr | Dot Net Training in porur | Dot Net Training in tambaram | Dot Net Training in velachery





    ReplyDelete