Thursday, September 12, 2013

save Query Results to File using sqlcmd

create a .sql file like

user database; select * from abc

for window authentication:
sqlcmd -i d:\share\testquery.sql -S localhost -E -o TestResults.txt

sqlcmd -i d:\share\testquery.sql -S 172.29.17.56 -E -o d:\share\TestResults.txt



No comments:

Post a Comment