SQL Server query result to file
-
30-04-2021 - |
質問
How can I save query result into file from sqsh console?
Google is talking about some gui tools I don't want to use.
PS: Linux
解決
I'm not familiar with sqsh but if it's a console tool, can you just pipe the output to a file?
sqsh <mycommand> >output.txt
他のヒント
From the SQSH homepage:
You may also redirect output to files and (if you are careful) can redirect input from files:
1> select * from sysobjects 2> go 2>/dev/null >/tmp/objects.txt
Not familiar with that "sqsh" shell you're talking about.... but on Windows, you could use the command-line sqlcmd
tool and execute a query against SQL Server, and capture the output into a file.
See:
所属していません StackOverflow