Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 How to select from data in copy of MSDB?

Author  Topic 

crichardson
Starting Member

6 Posts

Posted - 2008-03-14 : 08:51:45
In SQL Server 2000 I developed a utility stored procedure for synchronising all the jobs relating to a specified job category from one SQL Server instance to another. It was quite simple... I restored the MSDB database from a source server to the target server but restored as a different db name, eg. MSDB_Copy. The sproc then just queried some system tables like sysjobs and syscategories and recreated the jobs on the target server. Now, in SQL Server 2005, some things have changed of course! For example, if I do...

select * from msdb_copy.dbo.syscategories

The result is from msdb.dbo.syscategories! Obviously, this is because 2005 have replaced the old concept of system tables with views. The question is, can anyone suggest a way to select data from 'tables' like syscategories in a copy of the MSDB database?

Thanks,
Clive

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-03-14 : 09:38:40
This is really bad practice.
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2008-03-14 : 09:41:31
why don't you just use SSMS to script out the jobs from the source Server and apply it over at the target ?


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-03-14 : 09:43:49
There is a control task in SSIS called transfer job. You should use it achieve that.
Go to Top of Page

crichardson
Starting Member

6 Posts

Posted - 2008-03-14 : 14:24:27
Thanks for the comments.

Go to Top of Page
   

- Advertisement -