June 24, 2009 at 6:01 am
Hello everyone,
I hve been using BCP for bulk loading successfully before I encountered this issue on one of our server.
I was able to create a format file with any row or field terminator using following statement
bcp SSCommerceServer.dbo.shop_receipt format nul -n -f c:\BCPFF1\dummy.fmt -T
when the same statement is used with row and field delimeter im getting error stating the -r is neither internal or external command.
bcp SSCommerceServer.dbo.shop_receipt format nul -n -f c:\dts_store\BCPFF1\dummy.fmt -t || -r\p -T
or
bcp SSCommerceServer.dbo.shop_receipt format nul -n -f c:\dts_store\BCPFF1\dummy.fmt -t || -r\p -U XXX -P pppp (use -U to provide username or use -T for trusted connection)
Above two t-sql executes fine on other servers.
ps: replace n for p in row terminator specification. Browser doesnt seems to print them 🙂
Any suggestion will be helpful
Ta
June 24, 2009 at 7:55 am
The pipe character you are using as a terminator is also a batch script operator - you are effectively piping the result of the command to the statement after the pipe - hence the error.
Enclose the terminator characters in double quotes.
Paul
Paul White
SQLPerformance.com
SQLkiwi blog
@SQL_Kiwi
June 24, 2009 at 8:13 am
Hi Paul,
Thats exactly where the problem was!!
Thank you
June 24, 2009 at 8:18 am
Awesome 🙂
Paul White
SQLPerformance.com
SQLkiwi blog
@SQL_Kiwi
June 25, 2009 at 2:27 am
Hi Paul ,
A great thank you because this was exactly the same problem with my other post http://www.sqlservercentral.com/Forums/Topic741031-145-1.aspx were I was using PIPE as delimiter. Accidently it was you who helped me again. I didnt had any clue becoz it successfully inserted first 20000 + rows. But after your reply I did change to other delimiter on that BULK insert and it started to load all the rows.
Thank you for your spot on ...
Ta
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply