January 11, 2013 at 7:01 am
How to rename all the job in an sql server 2005? I need to add the servername to the jobnames?
January 11, 2013 at 7:47 am
Hi balasach82,
Lets say i have a job that is called Backup and my servername is BI-ONT this could be the query that you could use.
Update msdb..sysjobs
Set name = 'BI-ONT'+'_'+ name
where name = 'Backup'
If you don't use the Where clause de statement will update all your jobs.
Don't forget to refresh your object explorer after all of this.
Marbo
January 11, 2013 at 7:53 am
Don't update the system tables directly.
Instead use sp_update_job passing in the old name and the new name.
January 11, 2013 at 8:23 am
Yes, i didnt want to update the systables directly. thats why wanted to find the best way to do this.
Running the sp_update_job is the best method and no other "Accepted" way. Is it?
January 11, 2013 at 8:26 am
Yep, thats the documented way to do what you want to do.
January 12, 2013 at 2:36 pm
Got below error:
Cannot enable the Service Broker in database "msdb" because the Service Broker GUID in the database (XXXXX....) does not match the one in sys.databases (YYYYY.......).
I dont have an clue whether the master/msdb was restored from another server.
Can i create a new service broker. For this any precautions needed like i have to check all the existing service broker etc?
January 14, 2013 at 1:22 am
ALTER DATABASE XXX SET NEW_BROKER WITH ROLLBACK IMMEDIATE
First stop everything that uses service broker in MSDB, like DBMail or anything you have created manually.
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply