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
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
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
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
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: