1. 扩展存储过程xp_cmdshell用法:
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
--1.启用 SP_CONFIGURE 'show advanced options',1 RECONFIGURE GO SP_CONFIGURE 'xp_cmdshell',1 RECONFIGURE GO --2.用法 master..xp_cmdshell 'DIR D:' --3.关闭 SP_CONFIGURE 'xp_cmdshell', 0 RECONFIGURE GO SP_CONFIGURE 'show advanced options', 0 RECONFIGURE GO
2.利用Package(.dtsx)加载数据文件到DB中:
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
master..xp_cmdshell 'F:FCapSSISPkgScriptsWorkingDTSBinndtexec /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""'