1
votes

I am trying to set a parameter while executing a package from command line

dtexec /f mypackage.dtsx /set \package.variables[$Project::MRNS_Database].Value;myvalue

I get the below error

The package path referenced an object that cannot be found: "\Project.Variables[$Project::MRNS_Database]". This occurs when an attempt is made to resolve a package path to an object that cannot be found.

In fact the MRNS_Database is actually a parameter set at project level (I can see this under Parameters in Package Explorer). Also I am not able to use the /Par switch as i am using /File option.

How do i set the parameter in this case from command line dtsexec?

2

2 Answers

2
votes

As Ferdipux points out you need to reference your ispac file. Make sure you have builed your project otherwise it can cause errors.

Make sure everything is on ONE line if you use bat file. I also included package parameters if you have those.

Bat file

@ECHO OFF
ECHO.
ECHO This is a batch file
ECHO.

DTEXEC.EXE /Project "C:\Users\thoje\Documents\Visual Studio 2015\Projects\Integration Services Project8\Integration Services Project8\bin\Development\Integration Services Project8.ispac" /Package Package24.dtsx /Set \Package.Variables[User::Test3].Value;1 /set \Package.Variables[$Package::Test2];1 /set  \Package.Variables[$Project::Test4];1
PAUSE
CLS
2
votes

You have to specify ISPAC Project file as well, like this example

DTEXEC /Project "Path to proj\YourProj.ispac" /Package "yourpackage.dtsx"  
/Set \Package.Variables[$Project::MRNS_Database];yourvalue  

More details in Microsoft dtexec Reference.