SQL SERVER – Running SSIS Package From Command Line

I previously wrote article SQL SERVER – Import CSV File into Database Table Using SSIS. I was asked following question by reader that how to run the same SSIS package from command prompt.

This is really interesting question and very easy one as well. You can execute SSIS Package using command line utility.

C:\>dtexec.exe /F "C:\ImportCSV\Package.dtsx"

When you run above command it will give you start time, end time and total progress of the package as well.

There are various options of the DTEXEC available you can see that using dtexec.exe /?

In future we will see how the SSIS task can be configured in scheduled task.

Reference : Pinal Dave (http://blog.SQLAuthority.com)

21 thoughts on “SQL SERVER – Running SSIS Package From Command Line

  1. Hi Pinal! How are you! Long time no see! Hope everything is fine.
    I’m writing to you ’cause I noticed you mentioned DTExec. I’ve wrote an alternative version called DTLoggedExec that has some additional features that the original one and make life simpler to BI Developers.
    It’s available on CodePlex, along with the source code, here:


  2. Pingback: SQL SERVER – Running SSIS Package in Scheduled Job Journey to SQLAuthority

  3. Have you tried to set variable values using /SET option, it doesn’t work from the SSIS execute utility, or command line or SQL Job.

    I tried all options to pass any variable and all fails, the error is:

    Executed as user: DOMAIN\Mike. Microsoft (R) SQL Server Execute Package Utility Version 10.50.2500.0 for 64-bit Copyright (C) Microsoft Corporation 2010. All rights reserved. Started: 3:04:46 PM DTExec: Could not set \Package.Variables[User::EmpIds].Value value to 1. Started: 3:04:46 PM Finished: 3:04:47 PM Elapsed: 0.359 seconds. The package execution failed. The step failed.

    This is all the combinations i have set to pass my variable to the SSIS package:


    any help is much appreciated.

    –Note: we met @ MVPsummit were we lined up to take our bus if you remember and we had a little discussion :)


  4. Pingback: SQL SERVER – Weekly Series – Memory Lane – #030 | SQL Server Journey with SQL Authority

  5. Hi all… I have issue to excute this task ( DTExec.exe /f TEST.dtsx ) BUT, there is nothing been inserted. When I try to execute SSIS using VStudio. It’s working.

    Output :

    Source: Data Flow Task 1 Lookup [84]
    Description: The component “Lookup” (84) encountered duplicate reference key
    values when caching reference data. This error occurs in Full Cache mode only. E
    ither remove the duplicate key values, or change the cache mode to PARTIAL or NO
    DTExec: The package execution returned DTSER_SUCCESS (0).



  6. Hi all,

    This is rajesh from heyderabad ,if we have any doubts in sql related question plz post.
    i will give the solution for u r queries.

    Than ks,



  7. Hi Sir, Can I run a SSIS Package (.dtsx) remotely using C# application which is invoked using Application Server? The application Server is running from a machine which doesn’t have any SQL server instance or SQL integration service installed. If I install dtexec.exe without any tools, is it going to work? I can get dtexec.exe from my machine and can copy to Application server machine.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s