Question

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

Was it helpful?

Solution

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

OTHER TIPS

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:

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top