Server Variables in Script Library

Andrew (22 posts)
October 24, 2016 12:53 PM
Accepted Answer


I've run into some trouble with a script library. From my testing, it appears like my Script Library is unable to read variables scoped at the server-level. Is this true?

In my script library, I'm doing this:

string connectionString = adTempus.JobVariables["performext_database_connection_string"];
adTempus.LogMessage(MessageTypeEnum.Informational, 0, String.Concat("Connection String: ", connectionString));

That variable is defined at the server-level (Tools->Server Options->General Options->Variables). When viewing the log, the connectionString variable is empty and I get a subsequent error message about an uninitialized connection string (the SqlConnection object confirming it's empty).

For testing, I set the variable at the job-level and the job completed successfully. When I deleted the variable and re-inherited it from the server, the job failed again.

Any truth to this?

Bill Staff (602 posts)
October 24, 2016 07:07 PM
Accepted Answer

Are you on adTempus

I tested this and it worked correctly for me. Is your job running on an Agent? If so, you may need to restart the Agent so it refreshes the server-level variables from the Master.

Andrew (22 posts)
October 28, 2016 11:02 AM
Accepted Answer

You're right. I could have sworn I recycled the agent but it's working now that the server variable was synced to the agent.

Thank you!

Replies are disabled for this topic.