Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sql-server/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql server 将数据从SQL Server导出到Excel_Sql Server_Export To Excel - Fatal编程技术网

Sql server 将数据从SQL Server导出到Excel

Sql server 将数据从SQL Server导出到Excel,sql-server,export-to-excel,Sql Server,Export To Excel,一,;我正在尝试使用此脚本自动将数据从sql server表导出到excel EXEC sp_makewebtask @outputfile = 'C:\testing.xls', @query = 'Select * from HCIndonesia_20Jul2010..Combine_Final', @colheaders =1, @FixedFont=0,@lastupdated=0,@resultstitle='Testing details'

一,;我正在尝试使用此脚本自动将数据从sql server表导出到excel

EXEC sp_makewebtask 
    @outputfile = 'C:\testing.xls', 
    @query = 'Select * from HCIndonesia_20Jul2010..Combine_Final', 
    @colheaders =1, 
    @FixedFont=0,@lastupdated=0,@resultstitle='Testing details'
但是我;我得到一个错误:

Msg 15281,第16级,状态1,程序xp_makewebtask,第1行 SQL Server阻止访问组件“Web助手过程”的过程“sys.xp\u makewebtask”,因为此组件作为此服务器安全配置的一部分已关闭。系统管理员可以使用sp_configure启用“Web助手过程”。有关启用“Web助手过程”的详细信息,请参阅SQL Server联机丛书中的“表面积配置”

这可能对你有帮助

听起来你只需要做:

sp_configure 'Web Assistant Procedures', 1
RECONFIGURE 

您的脚本应该可以工作(只要您在SQL server上有权限)

hmm。现在我遇到了另一个问题:Msg 17750,级别16,状态0,过程xp_makewebtask,第1行无法加载DLL xpweb90.DLL或它引用的某个DLL。原因:126(找不到指定的模块)。是否需要获取.dll?@marilyn-看起来此错误是由于试图在SQL Express上运行此SP造成的-此存储过程(根据谷歌的说法)已被弃用,因此您可能应该研究另一种执行此操作的方法。