BCP Help

Last Post 21 Aug 2006 11:20 AM by srmerchant97. 3 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
srmerchant97
New Member
New Member

--
21 Aug 2006 06:56 AM
Hi All,

I am new to BCP and need some help.
I am trying to import a text file into Sql Server table.
The text files have the following attributes.
First Row is a Header- Yes
Row Delimiter - {CR}{LF}
Column Delimiter - Pipe/Vertical bar/|
Text qualifier None.

I am using the following command to import the file and it errors out with the following error

bcp [ABC-123].Pubs.dbo. authors in C:\Temp\Imports\ authors.txt -c -t , -r \n - ABC-123 -Usqllogin -Pxxxxxxxx

Error:
Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near '.'.

Please help,

Thanks,

Ray
BCP Help
nosepicker
New Member
New Member

--
21 Aug 2006 08:41 AM
Don't use the servername at the beginning (when you used the 4-part naming convention). You have a space between "dbo." and "authors". You need a "-S" in front of your servername parameter:

bcp Pubs.dbo.authors in C:\Temp\Imports\ authors.txt -c -t , -r \n -SABC-123 -Usqllogin -Pxxxxxxxx

srmerchant97
New Member
New Member

--
21 Aug 2006 08:51 AM
thanks nosepicker,

I have those changes made and still get the same error message....
Does sql server get wacky when it see a server name as ABC-123. I know for linked server qry I need to do [ABC-123].DBNAME.DBO.TABLEName. But I tried the servername enclosed in [], single quotes and still the same error message...

srmerchant97
New Member
New Member

--
21 Aug 2006 11:20 AM
Tried 2 single quotes and a double quote.
Same error message....
You are not authorized to post a reply.

Acceptable Use Policy