Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Queryout bcp error? Works when using table name.

Status
Not open for further replies.

gcole

Programmer
Aug 2, 2000
390
US
The following command works if I sub a 'table name' for the query and 'out' for queryout':

execute master..xp_cmdshell "bcp " Select Time1, Time2, Forced From in_tblname" queryout d:\transfer\test.txt -c -q -t,"

I am getting this error:
"Incorrect syntax near ' queryout d:\transfer\test.txt -c -q -t,'.
"

Can anyone spot the problem?
 
If you receive an error like that in combination with quotes always change your outer double quotes into single quotes.

And you should use your DBNAME.OBJECTOWNER.OBJECTNAME identifier. Otherwise you could have some problems too.

That should do the trick

Hope this helps
GL


Rosko
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top