1. 扩展存储过程xp_cmdshell用法:
--1.启用SP_CONFIGURE 'show advanced options',1RECONFIGUREGOSP_CONFIGURE 'xp_cmdshell',1RECONFIGUREGO--2.用法master..xp_cmdshell 'DIR D:\'--3.关闭SP_CONFIGURE 'xp_cmdshell', 0 RECONFIGURE GOSP_CONFIGURE 'show advanced options', 0 RECONFIGURE GO
2.利用Package(.dtsx)加载数据文件到DB中:
master..xp_cmdshell 'F:\FCapSSISPkg\Scripts\Working\DTS\Binn\dtexec /FILE Package文件路径\PackageName.dtsx /DECRYPT XXXXXX /set \Package.Variables[Server].Value;"\".\"" /set \Package.Variables[ServerFIS].Value;"\".\"" /set \Package.Variables[BaseFolder].Value;"\"E:\要加载的文件的路径\"" /set \Package.Variables[参数名].Value;"\"参数值1\"" /set \Package.Variables[参数名].Value;"\"参数值1\""'