Comments
8 comments
-
Hi there,
Unfortuantely, we don't have anything in our arsenal that will do this I am afraid, however we do already have a feature request under ref SC-2456 which is to compare system databases.
I am afraid to say though that currently we do not know when / if this will be implemented or not, however the more people post requesting the feature the more likely it is to be implemented.
Pete -
I would use this, so +1.
-
I would use this, when will it be available?
-
Matt_B wrote:I would use this, so +1.
I would as well! +1 -
Can someone at RedGate give us an update when SQL Data Compare will be able to compare system tables?
-
Anyone know the status of SC-2456 (mentioned by peter.peart in a 2012 post on this thread)?
-
We are still interested in this feature is there an update. Any status updates from this thread?
-
One way to do this is to add views to the msdb databases on both nodes/servers that act as a non-system-object "proxy"
You can then use SQL DATA Compare with the option "include views"
and then set comparison keys in SQL DATA COMPARE tables & views to use the names instead of uuids
and then exclude identifier/modified/version columns from comparison
e.gUSE msdb;GOCREATE OR ALTER VIEW sysjobs_proxyASSELECT *FROM msdb.dbo.sysjobs AS j;GOCREATE OR ALTER VIEW sysjobsteps_proxyASSELECT st.*,j.job_id AS j_job_id,j.name AS job_nameFROM dbo.sysjobsteps AS stINNER JOIN dbo.sysjobs AS jON j.job_id = st.job_id;GOCREATE OR ALTER VIEW sysjobschedules_proxyASSELECT jsc.*,j.job_id AS j_job_id,j.name AS job_name,sc.name AS shedule_name,sc.schedule_id AS sc_schedule_idFROM msdb.dbo.sysjobschedules AS jscINNER JOIN dbo.sysjobs AS jON j.job_id = jsc.job_idINNER JOIN dbo.sysschedules AS scON sc.schedule_id = jsc.schedule_id;GOCREATE OR ALTER VIEW sysschedules_proxyASSELECT *FROM msdb.dbo.sysschedules AS s;
However - this does not yield any usable scripts to switch job-step order etc..
It's easier to script out the job with DROP and CREATE and alter top portion
IF EXISTS (SELECT 1 FROM msdb.dbo.sysjobs WHERE name='JOBNAME'BEGINDECLARE @jobId BINARY(16)SELECT @jobId=job_id FROM msdb.dbo.sysjobs WHERE name='JOBNAME'EXEC msdb.dbo.sp_delete_job @job_id=@jobId, @delete_unused_schedule=1END
Add comment
Please sign in to leave a comment.
Is there a way to quickly compare SQL Server Agent jobs, either with T-SQL scripts or with another server?
Thanks in Advance,
Nigel