I have some SSIS packages that are stored in the SQL Server and exposed via a SQL Agent Job
I have written a component that allows me to dynamically build up the correct command line for the job step containing the SSIS package which allows me to override package variables using the /SET command
Unfortunately, in SMO, I need to do the following:
jobStep.Command = MyNewComandString;
jobStep.Alter();
parentJob.Start();
The problem with this approach is that it requires me to call .Alter() in order for the new command line to take effect, which updates the JobStep definition on the SQL Server Agent. If I don't call Alter() and just call Start() then it will not take effect
This is obviously a PITA because now I need to worry about 'restoring' the original Command line ...is there any way I can pass a custom command string to the JobStep, have it execute without having to call Alter() and thus be responsible for restoring the original command line?
BTW xp_cmdshell is not an option