How to run package (catalog) from PowerShell with Environment variable in DTExec

  • Hello Everyone,

    I am new to PowerShell. I don't even know the basics. I have used the below script and able to run the package successfully.

    But the problem with this script is it just triggering the package and returning the execution id. Not sure whether the package got succeeded or not.

    https://docs.microsoft.com/en-us/sql/integration-services/ssis-quickstart-run-powershell?view=sql-server-2017

    Later I have tried with the below command.

    dtexec /Server "SERVER-INSTANCE" /envreference "DEV" /isserver "\SSISDB\Sample\Sample\pkg_Sample.dtsx" /par "$ServerOption::SYNCHRONIZED(Boolean)"

    But it is failing with "Argument ""::SYNCHRONIZED(Boolean)"" for option "parameter" is not valid." error.

    Please help me to resolve this issue.

  • What was your attempt with Package.Execute? My impression was the powershell version works the same way at the .net Package.Executefunction, and the documentation states there:

    The Execute method calls the Validate method implicitly before the package runs. All tasks in the package are reviewed for appropriate settings during validation, and all objects in the package are reviewed, including the package, containers, and other components in the package.

    If there are no problems encountered in the validation phase that would cause the package to fail, the package object proceeds to call the Execute method for each task and object in the package.

    So, the packages will be fully executed and then the result will be passed back. That's my understanding anyway.

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • dtexec /Server "SERVER-INSTANCE" /envreference "DEV" /isserver "\SSISDB\Sample\Sample\pkg_Sample.dtsx" /par "$ServerOption::SYNCHRONIZED(Boolean)"

     

    the red part i highlighted is the definition, and not the value, isn't it?

    i think it is supposed to actually also have the True value:

    dtexec /ISserver SSISDBDemoMyCatalogProject2-RowCounts.dtsx /Par "$ServerOption::SYNCHRONIZED(Boolean)";True

    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 3 posts - 1 through 2 (of 2 total)

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