pansophy
asked on
SQL table export to text file sorted by 2 columns
I have a query that I would like to export to a text file using SQL Server Import and Export Wizard. The query itself has the columns to sort by, but upon export the text file is not sorted.
What is an easy way to export the query sorted?
Thanks...
What is an easy way to export the query sorted?
Thanks...
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
exec master..xp_cmdshell N'sqlcmd -E -Q"select * from server_name.dba_name.schem
for more info on sqlcmd switches and impact in output file format please see:
http://msdn.microsoft.com/en-us/library/ms162773.aspx