execute SSIS package from .bat file

  • Hello SSC,

    I have a question about executing SSIS packages from a .bat file. I have been on a few blogs and it looks like I have to configure the SSIS package to do this. I was hoping that I could just create a .bat file to execute the file system SSIS package. It looks pretty straight forward, but I am unsure if I have to do anything with my package.

    Any help would be greatly appreciated.

    Thanks as always :).

    Everyone has a plan until they get punched in the mouth. --Mike Tyson

  • the executable you want is dtexec.exe. that executable can launch a dtsx package from the  command line, and you do not need to make any modifications to your package.
    mine is located here on my machine: note the double quotes to to spaces in the path.
    "C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn\dt
    exec.exe" /?
    a proper example to call a package, without making any changes to any variables would look like this; you can google a bit if you need to assign values to variables.

    "C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn\dtexec.exe" /FILE "C:\Folder with spaces\Package.dtsx"

    the /? gives you some flag information

    C:\Users\lizaguirre>"C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn\dt
    exec.exe" /?
    Microsoft (R) SQL Server Execute Package Utility
    Version 14.0.0500.272 for 32-bit
    Copyright (C) 2016 Microsoft. All rights reserved.

    Usage: DTExec /option [value] [/option [value]] ...
    Options are case-insensitive.
    A hyphen (-) may be used in place of a forward slash (/).
    /Ca[llerInfo]
    /CheckF[ile]   [Filespec]
    /Checkp[ointing]  [{On | Off}] (On is the default)
    /Com[mandFile]  Filespec
    /Conf[igFile]   Filespec
    /Conn[ection]   IDOrName;ConnectionString
    /Cons[oleLog]   [[DispOpts];[{E | I};List]]
           DispOpts = any one or more of N, C, O, S, G, X, M, or T.
           List = {EventName | SrcName | SrcGuid}[;List]
    /De[crypt]    Password
    /DT     PackagePath
    /Dump     code[;code[;code[;...]]]
    /DumpOnErr[or]
    /Env[Reference]  id of an Environment in the SSIS catalog
    /F[ile]     Filespec
    /H[elp]     [Option]
    /IS[Server]   Full path to the package in the SSIS catalog
    /L[ogger]    ClassIDOrProgID;ConfigString
    /M[axConcurrent]  ConcurrentExecutables
    /Pack[age]    Package to run inside of the project
    /Par[ameter]   [$Package::|$Project::|$ServerOption::]parameter_name[(data_
    type)];literal_value
    /P[assword]   Password
    /Proj[ect]    Project file to use
    /Rem[ark]    [Text]
    /Rep[orting]   Level[;EventGUIDOrName[;EventGUIDOrName[...]]
           Level = N or V or any one or more of E, W, I, C, D, or P.
    /Res[tart]    [{Deny | Force | IfPossible}] (Force is the default)
    /Set      PropertyPath;Value
    /Ser[ver]    ServerInstance
    /SQ[L]     PackagePath
    /Su[m]
    /U[ser]     User name
    /Va[lidate]
    /VerifyB[uild]  Major[;Minor[;Build]]
    /VerifyP[ackageid] PackageID
    /VerifyS[igned]
    /VerifyV[ersionid] VersionID
    /VLog     [Filespec]
    /W[arnAsError]
    /X86

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply