Export Result of query to file SQL Server
I have a complex query, when I execute it, I get a big table so I would like to export it to a file, instead of inserting it to a table.
for example, lets say we have a query:
select
(select Name from Table1 where ID = 1),
(select Name from Table2 where ID = 25),
...
How would I export r开发者_Go百科esult to a file?
You do this directly in SSMS? There is a button in the toolbar labeled Results To File which does exactly what you want. Or you can use openrowset
精彩评论