none
running ssis package from command line

    Question

  • I have created an SSIS package (stored on the file system) that loads a csv file into an SQL table.     The package was created with protectionlevel EncryptSensitiveWithPassword.     I run a 'bat' file containing the following:

    cd c:\Program Files (x86)\Microsoft SQL Server\100\DTS
    DTExec.exe /f "C:\package.dtsx" /De "packagepassword"

    This all appears to work and loads the data.    I would like to do this without password protecting the package.     I don't want to do it with a userkey, I want to put it on a couple of other workstations.     If I use DontSaveSensitive, I lose my database connection information and the package doesn't work when I run the 'bat' file.     

    Is there a way of doing this without password protecting the package?    

    Monday, April 15, 2013 9:38 PM

All replies

  • You can put the sensitive information into a package configuration, but that is going to possibly expose that information to prying eyes.  There are a few methods using SQL Encryption for handling this.

    You can use the EncryptSensitiveWithUserKey option.  You would have to set the sensitive information when developing the package running as a particular user.  Then you run the package as that user. 


    Russel Loski, MCT, MCSA SQL Server 2012, 2008, MCITP Business Intelligence Developer and Database Developer 2008 Twitter: @sqlmovers; blog: www.sqlmovers.com

    Tuesday, April 16, 2013 12:35 AM
  • As long as these workstation and SQL Server belongs to the same domain or forest, you can use Windows authentication instead of SQL Server authentication.

    In such scenario you grant privileges to windows logins of users who are allowed to run the package and domain controller will take care of the rest.

    With SQL Server authentication you have to save password somewhere...

    You may also save package without sensitive and then set connection string in batch file, but it is even worse...

    dtexec .... /SET "\Package.Connections[ConnectionManagerName].Properties[ConnectionString]";"connection with password"

    Tuesday, April 16, 2013 3:02 AM
  • I may try that Piotr.     This particular package only has update on one table, and will only be used by a couple of people, so for what I'm doing that will probably work for me.    Thanks for the feedback Piotr and Russ!

    Tuesday, April 16, 2013 11:55 AM