The following script generates the a script for chaning the Job Owner. Run this query in Query Analyzer. Copy the result to the clipboard and paste in a new query window. Execute it to change the owner of the listed jobs.
Select
[Use msdb]='Exec sp_update_job @job_id = ''' +
convert(varchar(85),j.job_id) +
''', @owner_login_name = ''newowner''' +
char(10) + '--' + j.name +
' is currently owned by ' + l.name
From msdb.dbo.sysjobs j
Left Join master.dbo.syslogins l
On j.owner_sid=l.sid
Where l.name='oldowner'
Or l.sid is null If you want to get the best answer for your question read faq183-874 and faq183-3179. Terry L. Broadbent - DBA
SQL Server Page:
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.