Schadenfreude-Mei (7/29/2010)
Havent tried it but would assume that you would pipe to an output file. something like:sqlcmd -S . -d master -Q "select name from sys.databases" -o "c:\output.csv"
But obviously inside a XP_cmd... statement.
Hope this helps. 🙂
SO in your case:
EXEC xp_cmdshell 'sqlcmd -S . -d master -i "c:\sqlscript.sql" -o "c:\output.csv"'
Or something like that. Simples (squeeky meercat noise!)
Adam Zacks-------------------------------------------Be Nice, Or Leave