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!

Syntax for OSQL cmd in QA

Status
Not open for further replies.

roswald

Programmer
Joined
Jul 6, 2002
Messages
152
Location
US
Can someone tell me how to get the syntax right for the following cmd in Query Analyzer...

set @cmd =
'OSQL -Uusername -Pmypwd -Q"select * from table"'

I have tried many combinations without any luck using single quotes so that it will work in a SP.
 
You need to use the extended procedure "xp_cmdshell". Refer to the BOL for the syntax directions.

-SQLBill

Posting advice: FAQ481-4875
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top