有没有一种方法可以SSIS
使用SSMS
或SSIS
包将包从MSDB数据库复制到文件系统。
我的尝试在哪里:
dtutil
与xp_cmdshell
in一起使用SSMS QUERY
EXEC xp_cmdshell 'dtutil /sourceserver SERVERNAME\INSTANCENAME /SQL "\TestingData\Package" /copy file;"c:\Package.dtsx"'
结果:
注意:使用xp_cmdshell
无时没有问题,dtutil
因为我成功完成了“文件复制”。
SSIS
component Execute Process task
。但是结果是:
Error: 0xC0029151 at Execute Process Task, Execute Process Task: In Executing "C:\Windows\System32\cmd.exe" "dtutil /sourceserver servername\instancename /SQL "\TestingData\Package" /copy file;"c:\Package.dtsx"" at "", The process exit code was "1" while the expected was "0". Task failed: Execute Process Task
There many things to take into consideration:
In the first screenshot, the output your are getting is that Access is denied, so first check that you have write permissions on C:\
drive, or try copying to another path.
Try reordering the parameters you are passing to the dtutil tool and remove the \
before the package path:
EXEC xp_cmdshell 'dtutil /SQL TestingData\Package /sourceserver SERVERNAME\INSTANCENAME /Copy File;"c:\Package.dtsx"'
在上面的命令中,必须对要连接的SQL实例进行Windows身份验证,因此,如果没有这种身份验证,请尝试使用SQL身份验证:
EXEC xp_cmdshell 'dtutil /SQL TestingData\Package /SourceServer SERVERNAME\INSTANCENAME /SourceUser Monkey_User /SourcePassword P@$$word /Copy file;"c:\Package.dtsx"'
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句