question

Chris 2 avatar image
Chris 2 asked

SQL script to set Run As option in job

Hi,

Is there a way to set SQL job step 'Run As' option? Thanks.

Chris

sql2016
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
MikeyBronowski avatar image
MikeyBronowski answered

Could you please elaborate on what exactly is your end goal?

The sprocs sp_update_jobstep and sp_add_jobstep have this parameter. Would that be helpful?

[ @database_user_name = ] 'user' The name of the user account to use when executing a Transact-SQL step. useris sysname, with a default of NULL.


See more sp_update_jobstep (Transact-SQL) - SQL Server | Microsoft Docs

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.