Hi. I am getting an error running a statement via sqlcmd when the exact statement runs fine via smms EXEC xp_cmdshell This is a local db with the default server (computer name) and instance (MSSQLSERVER). I have no usernames or passwords in the db- what am I missing? Thanks in advance. --This works perfectly in SSMS Query WindowEXEC xp_cmdshell 'bcp "SELECT * FROM mydb2.dbo.MyTable" queryout "C:\Users\Owner\Documents\Work_NET\SQL\BCP_Test\MyTable.bcp" -E -c -b 1000 -t\¿ -SFRINK -T'
-------------------------------------------------------This returns the error "Msg 102, Level 15, State 1, Server FRINK, Line 2 Incorrect syntax near 'queryout'."--1) The myFile.sql only contains the text:bcp "SELECT * FROM mydb2.dbo.MyTable" queryout "C:\Users\Owner\Documents\Work_NET\SQL\BCP_Test\MyTable.bcp" -E -c -b 1000 -t\¿ -SFRINK -T