sql server - Passing Source and Destination for SSIS package created from Export/Import Wizard of SSMS -
i have created ssis package sql server management studio. , working.
but pass source connection string , destination connection string ssis package when run this.
one approach planning run package dtexec tool. there other options?
overview
ssis, via import export wizard, available in editions of sql server. however, sql server express not allow ability save package generated using wizard. , saved package operating on.
what can make dynamic
you have correctly identified can change connection strings within ssis package. future readers, connection string not specify table, or schema, name. if want make object name dynamic, cannot accomplish packages built using import/export wizard.
how change connection strings
we have established packages have been saved out of import/export wizard although package built using bids/ssdt-bi equally valid. mechanics of running package commonly performed through dtexec utility. among other things, allows specify new value connections
/conn[ection] id_or_name;connection_string [[;id_or_name;connection_string]…]: (optional). specifies connection manager specified name or guid located in package, , specifies connection string.
this option requires both parameters specified: connection manager name or guid must provided in id_or_name argument, , valid connection string must specified in connection_string argument.
open favorite text editor , point @ package saved out.
<dts:connectionmanagers> <dts:connectionmanager dts:refid="package.connectionmanagers[destinationconnectionoledb]" dts:creationname="oledb" dts:dtsid="{6d24e79d-7912-4cb2-88e1-d85a37c21ecf}" dts:objectname="destinationconnectionoledb"> <dts:objectdata> <dts:connectionmanager dts:connectionstring="data source=.\dev2014;initial catalog=master;provider=sqlncli11;integrated security=sspi;auto translate=false;" /> </dts:objectdata> </dts:connectionmanager> <dts:connectionmanager dts:refid="package.connectionmanagers[sourceconnectionoledb]" dts:creationname="oledb" dts:dtsid="{a9768f28-28f6-4e61-8717-24b39db0be77}" dts:objectname="sourceconnectionoledb"> <dts:objectdata> <dts:connectionmanager dts:connectionstring="data source=avathar\dev2014;initial catalog=phoenix;provider=sqlncli11;integrated security=sspi;auto translate=false;" /> </dts:objectdata> </dts:connectionmanager> </dts:connectionmanagers>
that results in call like
dtexec /file c:\ssis\pkg1.dtsx /conn "sourceconnectionoledb";"\"data source=localhost\testsql2008r2;initial catalog=conndb;integrated security=sspi;\"
Comments
Post a Comment