SQL Agent Job Step Properties GUI - Command field in sysjobsteps and double quotes

I am trying to create a PowerShell script to run sp_upate_jobstep to specifically update the command field for an Agent job running a SSIS step.

The initial setup was done using the GUI in SQL Management Studio 2014.

I have noticed that when I run sp_help_job and retrieve the command field, that there is some what I would call interesting behaviour surrounding some the strings in the command. For example, if the specific value is a alphanumeric string, I get the following:

/Par SomeParameter;ABCD123

But, if there are any none alphanumeric characters, I get the following:

/Par SomeParameter;"\"ABCD_123\""

I would have only expected that kind of behaviour if the specific string had a space in it.

I have done a little bit of testing and have so far confirmed that if I run sp_update_jobstep and exclude the double quotes and the back slash for a string without spaces, such as:

/Par SomeParameter;ABCD_123

sp_update_jobstep still completes and the agent job still runs.

Is anyone able to confirm that this approach is OK? If not, can anyone confirm which scenarios I need to double quote and backslash for? Is it all non alphanumeric?

Cheers



  • Edited by Hoffy73 5 hours 15 minutes ago
September 13th, 2015 9:48pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics