Error when Running SSIS Package which has variables from Project.Params file using .bat file

bstar_ 61 Reputation points
2021-02-25T07:51:20.987+00:00

Hi all,
I am running my SSIS Package using .Bat file but encountered some errors.
Currently, the SSIS Package is using project level variables which is stored in Project.params file.

When i run the package using .bat file, i encountered errors saying that the variable is not found.

May i know how do i run SSIS Package with Project.Params?
Can i run .sln file using .bat file?

Any help is appreciated!

SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,452 questions
0 comments No comments
{count} votes

Accepted answer
  1. Yitzhak Khabinsky 24,946 Reputation points
    2021-02-25T13:21:11.84+00:00

    @bstar_ ,

    SSIS has two environments:

    • Development environment, on a dev. workstation with Visual Studio and SSDT.
    • Run-Time environment, on a server with SQL Server instance and SSISDB Catalog.

    That Project.Params file is not used by the SSIS run-time environment.

    It is just for VS during development time, and deployment phase of a SSIS Project to a server. After deployment is over, all parameters are housed in the SSISDB database. No files after that.

    0 comments No comments

3 additional answers

Sort by: Most helpful
  1. Monalv-MSFT 5,891 Reputation points
    2021-02-25T08:26:42.957+00:00

    Hi @bstar_ ,

    Could you please share the detailed error messages?

    We can use DTEXEC Utility or batch file to execute ssis packages.

    1.Dtexec /isserver "SSISDB\MyFolder\MyProject\MyPackage.dtsx" /server "." /parameter $Project::myparam;myvalue /parameter anotherparam(int32);12

    2.@Echo OFF
    CLS
    ECHO You are about to execute the TestPackage SSIS package
    PAUSE
    "c:\Program Files\Microsoft SQL Server\110\DTS\Binn\DTEXEC.exe" /File "C:\SSIS\TestPackage.dtsx"
    PAUSE

    Please refer to dtexec Utility and How to execute an SSIS package from the command line or a batch file.

    Best regards,
    Mona

    ----------

    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. bstar_ 61 Reputation points
    2021-02-25T09:09:54.027+00:00

    Hi @Monalv-MSFT !

    My SSIS packages are using project level parameters which are stored in the Project.Params file. i am running my SSIS Package using .bat file (similar to the command you stated excluding the /set paramter command). Below is the error:

    Error: 2021-02-25 17:03:00.80
    Code: 0xC00470A6
    Source: Package
    Description: The variable '$Project::folder' was not found in the Variables collection. The variable might not exist in the correct scope
    End error

    I am not using .bat file to /SET parameter value.
    All parameters are set in the Project.Params file
    Is there any method to run the ssis package which use project parameters using .bat file

    0 comments No comments

  3. bstar_ 61 Reputation points
    2021-02-26T03:07:08.93+00:00

    Hi @Yitzhak Khabinsky ,

    Thanks for your explanation!
    It is really helpful.

    Thanks a lot for your help!

    0 comments No comments