动态连接数据库便于维护
用SSIS包配置实现
1、控制流页签 - 右键 - 包配置
2、配置xml文件
3、指定连接属性:ServerName、UserName、Password
测试:
1、配置错误
2、正确配置
<?xml version="1.0"?><DTSConfiguration><DTSConfigurationHeading><DTSConfigurationFileInfo GeneratedBy="Joe-PC\Joe" GeneratedFromPackageName="HRPC" GeneratedFromPackageID="{6403CC76-1E3C-4F05-A51B-69C1ACFCAE38}" GeneratedDate="2015/9/17 10:33:03"/></DTSConfigurationHeading> <Configuration ConfiguredType="Property" Path="\Package.Connections[浪潮GS].Properties[Password]" ValueType="String"><ConfiguredValue>aaaaaa</ConfiguredValue></Configuration> <Configuration ConfiguredType="Property" Path="\Package.Connections[浪潮GS].Properties[ServerName]" ValueType="String"><ConfiguredValue>192.168.8.4</ConfiguredValue></Configuration> <Configuration ConfiguredType="Property" Path="\Package.Connections[浪潮GS].Properties[UserName]" ValueType="String"><ConfiguredValue>lc0019999</ConfiguredValue></Configuration></DTSConfiguration>