question

bstar-3908 avatar image
0 Votes"
bstar-3908 asked Monalv-msft edited

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

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
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

YitzhakKhabinsky-0887 avatar image
0 Votes"
YitzhakKhabinsky-0887 answered

@bstar-3908,

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.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Monalv-msft avatar image
0 Votes"
Monalv-msft answered Monalv-msft edited

Hi @bstar-3908 ,

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.




5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

bstar-3908 avatar image
0 Votes"
bstar-3908 answered bstar-3908 edited

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

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

bstar-3908 avatar image
0 Votes"
bstar-3908 answered

Hi @YitzhakKhabinsky-0887 ,

Thanks for your explanation!
It is really helpful.

Thanks a lot for your help!

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.