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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

bcp query help, urgent

Status
Not open for further replies.

mkey

Programmer
Joined
Oct 3, 2001
Messages
288
Location
CA
Hi All,
I am trying to bcp out. My query looks something like this:

bcp "SELECT a.* FROM (((PIPENET..area_event_range a INNER JOIN PIPENET..event_report b ON a.event_id = b.id) INNER JOIN PIPENET..pn_alignment_sheet c
ON b.id = c.event_report_id) INNER JOIN PIPENET..pn_location d ON c.alignment_sheet_name = d.alignment_sheet_name)
WHERE d.operating_area_name = 'ONTARIO' ORDER BY A.EVENT_ID" queryout d:\ONTARIO.txt -c -t$ -SSERVER_ONE -Usa -P

The query is not working properly. I think its something to do with the brackets.
Any suggestions would be of help!
mkey
 
It strange but when I manually type in the DOS prompt the bcp works fine. But when I run as a batch file its giving me errors. Thank you all anyways!!
 
hey arrowhouse,
I have fixed the problem. I think the batch file has to be a continues one line statement. I had four lines in my batch file and when I changed the entire script to one line the batch file runs perfectly.
Thank you for you help!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top