将查询结果导出到Excel工作表 [英] export the query results to a Excel sheet

查看:142
本文介绍了将查询结果导出到Excel工作表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我使用带循环的后续查询提取了一些结果.

Hi all,

I have extracted some results using the follwing query with loop.

declare @TwoByteCodes_ID INT
while(@TwoByteCodes_ID <=355)
set @TwoByteCodes_ID=1
BEGIN
select Byte_0F,Byte_0E,Comments,
dbo.fn_GetTwoByteFamily(Byte_0E, Byte_0F)  AS Family,
dbo.fn_GetTwoByteConcatenatedIDVs(Byte_0E, Byte_0F) AS Internal_Die_Name
from Design_june27_2011.dbo.Autoselect_TwoByteExtendedCodes 
set @TwoByteCodes_ID=@TwoByteCodes_ID+1
END
go


我可以将这些查询结果与同一查询中的标头一起导出到新的Excel工作表中吗?


Could i export these query results into a new excel sheet along with headers in the same query?

kindly help.

推荐答案

SQL不知道Excel,因此您不能直接从SQL Server导出到Excel.

您可以从Management Studio复制查询结果并将其粘贴到Excel工作表中.
SQL does not know Excel so you can''t directly export to Excel from SQL Server.

You can copy the results of your query from Management Studio and paste them in an Excel sheet.


选中此链接

http://www.simple-talk.com/sql/t -sql-programming/sql-server-excel-workbench/ [
check this link

http://www.simple-talk.com/sql/t-sql-programming/sql-server-excel-workbench/[^]


这篇关于将查询结果导出到Excel工作表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆