使用sql脚本导出新的excel文件 [英] Export new excel file using sql script
本文介绍了使用sql脚本导出新的excel文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
hi
如何使用sql脚本进行Excel导出。我给出了示例程序。
该程序输出保存在一个excel文件中。它将存储在本地系统中。
这是我的要求??
注意:openrowset,opendatasource这种方法并不能满足我的要求。
hi
How to excel export using sql scripts. I given Example procedure.
That Procedure output save in one excel file. it will stored in local system.
this is my requirement??
NOTE: openrowset,opendatasource this method not full fill my requirements.
create table #test(empno int,empname varchar(25),address varchar(25))
insert into #test values('1','A','chennai')
insert into #test values('2','B','covai')
insert into #test values('3','C','madurai')
insert into #test values('4','D','chennai')
insert into #test values('5','B','covai')
insert into #test values('6','C','madurai')
insert into #test values('7','A','chennai')
insert into #test values('8','B','covai')
insert into #test values('9','C','madurai')
exec testing 'madurai'
IF OBJECT_ID('testing') IS NOT NULL
DROP PROCEDURE testing
GO
CREATE PROCEDURE testing
(
@address varchar(25)
)
as
begin
(
select * from #test where address=@address
)
end
推荐答案
proc_generate_excel_with_columns
请参阅以下链接
http://stackoverflow.com/questions/9086880/t-sql-export-to-new-excel-file [ ^ ]
proc_generate_excel_with_columns
refer this sp below link
http://stackoverflow.com/questions/9086880/t-sql-export-to-new-excel-file[^]
这篇关于使用sql脚本导出新的excel文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文