October 30, 2012 at 3:25 am
Hi experts,
I have a .csv file from which i have to do bcp out and bcp in, in command prompt and store the data into a table called temp.
How do i get the data into the table from a .csv file?
I have created the datafile and format file for temp.
How to get the values from .csv file and do bcp in to load it into the table 'temp'?
Please help me
Thanks in advance
October 30, 2012 at 4:34 am
I personally use a Bulk Insert statement:
BULK INSERT [tablename]
from '[Full File Path]'
WITH ( BATCHSIZE = 100000, FIELDTERMINATOR = ',' )
October 30, 2012 at 4:47 am
Thanks for ur reply
but i wanted to import using bcp instead of bulk insert...
October 30, 2012 at 5:26 am
What is the reasoning on using BCP?
But if you have the format file and the data in a csv format, all you need to do is build a BCP command using this link as a reference (http://msdn.microsoft.com/en-us/library/ms162802.aspx) with the right switches to import the data.
October 31, 2012 at 8:22 am
arthi.anan (10/30/2012)
Thanks for ur replybut i wanted to import using bcp instead of bulk insert...
There may, of course, be specific reasons for your choice though do bear in mind that Bulk Insert is typically faster and neater especially if used from within a Stored Procedure.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply