I am trying to execute a query through xp_cmdshell. when i run it through command prompt, it works fine.
but when i run the same through xp_cmdshell, it says 0 rows affected.
i have been able to use xp_cmdshell successfully before.
here are the 2 statements. i am running on sql server 7.0, sp 3.
bcp "select * from pubs.dbo.authors" queryout c:\Test\test2.txt -c -q -Sservername -U"username" -P"123"
exec xp_cmdshell 'bcp "select * from pubs.dbo.authors" queryout "c:\\Test\test2.txt" -c -q -Sservername -U"username" -P"123"'
thanks!