October 26, 2006 at 9:56 am
Does bulk insert use bcp at all to load data? I need to load some info into a table from a text file, but have been told to not use bcp.
Thanks for your time!
October 26, 2006 at 10:28 am
October 26, 2006 at 11:08 am
I was told that it doesn't work well in SQL server 2005 and that it will be completely phased out by the following release.
October 26, 2006 at 11:18 am
The entire DTS module is also being re-written in SQL Server 2005 into SSIS. Bulk Insert is part of DTS and will be included in the re-write. Both Bulk Insert and bcp work well in SQL Server 2000 in my opinion.
October 26, 2006 at 11:32 am
How about openrowset()? I've tried using it but Im running into some error when I try to compile.
I've tried using this:
INSERT INTO TABLE_A
SELECT * FROM OPENROWSET
(BULK 'S:\DATA\SUB\sub.txt')
Where S: is a network drive. Is this a bad idea? Would it be better to use the UNC name? I get the same error regardless.
Msg 156, Level 15, State 1, Line 3
Incorrect syntax near the keyword 'BULK'.
Thanks!
October 27, 2006 at 3:05 am
According to BOL this is not how you use OPENROWSET.
I am presuming here that TABLE_A has multiple columns and the data file represents this in a suitable format like .csv
You can use BCP to create a format file which specifies the mapping between file and table.
Then you can try BCP, OPENROWSET and BULK INSERT. The main difference seems to be that BCP runs out of process (as far as SQL Server is concerned).
October 27, 2006 at 11:42 pm
Bulk insert works like a champ. bcp is a command-line utility that also works well if you are extra special nice to it. Search for either topic in the forums (fora?) on this site and you should get loads of useful info. BOL is pretty accurate as well.
October 30, 2006 at 5:57 am
BULK INSERT can also use a format file for complex imports. For simple imports that all use the same column delimiter, you don't even need that... Bulk Insert is a little faster than BCP because BCP is actually a very robust probgram that does all sorts of error checking behind the scenes.
It'll be a sorry day if they ever get rid of BCP.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply