03 August,2021 by Tom Collins
Question: I have some t-sql code added to a job step on a SQL Server Agent job. The problem is I need to run the code as RUNAS . I though of executing the job with a proxy account - so progressed with the Credential & proxy set up. But I still can't view the Proxy\Credential in the RunAs list . Is there a way around this problem?
Answer: This is by design - you can't assign a proxy account to a t-sql step. The "standard" workarounds are
1) Use powershell to manage the t-sql execute. This requires assigning the Proxy account to a Powershell Proxy
2)Use sqlcmd to execute the code - this requires creating an operating system proxy
Read more
Xp_cmdshell – the most dangerous extended stored procedure on the planet
How to script CREDENTIALS for SQL Server migration
This is only a preview. Your comment has not yet been posted.
As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.
Having trouble reading this image? View an alternate.
Posted by: |