开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜