Mar 6, 2006 #1 roswald Programmer Jul 6, 2002 152 0 0 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.
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.
Mar 6, 2006 #2 SQLBill MIS May 29, 2001 7,777 0 0 US You need to use the extended procedure "xp_cmdshell". Refer to the BOL for the syntax directions. -SQLBill Posting advice: FAQ481-4875 Upvote 0 Downvote
You need to use the extended procedure "xp_cmdshell". Refer to the BOL for the syntax directions. -SQLBill Posting advice: FAQ481-4875