I would like to clarify how to reset a proxy used by specific job.
Assuming that I have a job and for the first step of the job I’m using proxy, and the proxy Id = 3
If you want to reset the step proxy back to Null, how you will do it?
Some of you may be misled by the article: http://msdn.microsoft.com/enus/library/ms189827.aspx
and will use the following command:
execsp_update_jobstep @job_id = N‘SOME JOB_ID’, @step_id = 1 , @proxy_name = NULL
In reality above command will do nothing, and the proxy for step 1 will remain unchanged
The only way to reset the proxy is to provide proxy name as empty string. You can see this logic in T-SQL code of sp_update_jobstep (note:@x_proxy_id is an old value of proxy_id):
IF (@proxy_id IS NULL)SELECT @new_proxy_id = @x_proxy_id
--if an empty proxy_name is supplied the proxy is removed
IF @proxy_name = N'' SELECT @new_proxy_id = NULL
So the right command to reset the job step proxy will be as following:
execsp_update_jobstep @job_id = N‘SOME JOB_ID’, @step_id = 1 , @proxy_name = N’’