[英]export to excel from sql query
I am trying to export to excel from the following query. 我正在尝试从以下查询导出到excel。 The following query doesn't work.
以下查询不起作用。 Please let me know.
请告诉我。 I appreciate any help.
感谢您的帮助。
INSERT INTO OPENROWSET ('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=c:\test.xls;','
select distinct a.a_name, b.b_name,
CASE WHEN a.rights = 1 THEN 'Yes' ELSE 'No' END AS rights
FROM TABLE_A a
JOIN TABLE_B b ON a.a_id = b.a_id')
You can use Export Import Wizard in SSMS. 您可以在SSMS中使用“导出导入向导”。
Additional info/ tutorial can be found here Please check http://www.kodyaz.com/articles/sql-server-export-to-excel-using-import-export-wizard.aspx 可以在此处找到其他信息/教程,请检查http://www.kodyaz.com/articles/sql-server-export-to-excel-using-import-export-wizard.aspx
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.