How do I add a task with an executbale file with configurable path in an SSIS package?

LarsNess
LarsNess used Ask the Experts™
on
I have a an SSIS package with SQL tasks only. Now I need to add a task that is supposed to run an executable file, but the path to the file should be configurable by the user. The filename and file parameters are fixed. I use SQL Server 2005. Can anyone help me?

Best regards,

Lars Næss
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Ved Prakash AgrawalSenior Manager, Database Engineering

Commented:
you can use DTEXEC with SET parameter to update the parameter file path.

http://msdn.microsoft.com/en-us/library/ms162810%28SQL.90%29.aspx

Author

Commented:
Hmm. Am I misunderstanding? I have the package. It is scheduled to run. All I need is a new task that does this:

<path>\BatchPrint.exe create 1

The only thing that needs to be configurable is the <path> to the filename that is executed within the task. Seems like DTEXEC is for running the package itself?

Commented:
You can execute the package with DTEXEC sending a parameter to a SSIS variable that will be dinamically set to the task in SSIS that will execute the EXE file..
Helped?
regards,
Pedro
Acronis in Gartner 2019 MQ for datacenter backup

It is an honor to be featured in Gartner 2019 Magic Quadrant for Datacenter Backup and Recovery Solutions. Gartner’s MQ sets a high standard and earning a place on their grid is a great affirmation that Acronis is delivering on our mission to protect all data, apps, and systems.

Author

Commented:
I am sending the SSIS package to a customer. It contains a configuration file. I want the SSIS package to be able to read the path from this configuration file when installing. I do the same for the connection string related to the other tasks now. I just don't know what to add to the configuration file and how to input it in the task, to be able to run the exe.
I believe this will do it for you.
Create a variable to hold the path. In your configuration file, assign a value to the variable.
Using an Execute Process Task, go to the Expressios tab. Set the Property for Executable to and expression Varaible + "BatchPrint.exe"
That will do it for you.
Good Luck
HZ

Author

Commented:
Thanks. I am trying. I have created a variable. How do I reference it in the "Executable" property of the task? I tried %variable name%\filename, but that didn't work.

Author

Commented:
I also tried this (just testing with winword.exe):

@RolloverNoticeExePath\WINWORD.EXE

No luck.

Author

Commented:
Never mind. Got it working with this:

@[User::RolloverNoticeExePath] + "\\winword.exe"

Thanks a LOT :-)

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial