How can we help you today? How can we help you today?
Lxocram
Chris, 128 is returned I've tried it again with an other table creation script (SSMS) CREATE TABLE [dbo].[kzlst_Opleiding_Voorzitter]( [ID] [int] IDENTITY(1,1) NOT NULL, [ID_Opleiding] [int] NOT NULL, [ID_Opleidingsvoorzitter] [int] NOT NULL, [Geldig_Van] [datetime] NOT NULL, [Geldig_Tot] [datetime] NOT NULL, [GELDIG] AS (case when [Geldig_Van]<dateadd(day,(0),datediff(day,(0),getdate())) AND [geldig_Tot]>=dateadd(day,(0),datediff(day,(0),getdate())) then (1) else (0) end), [ID_Departement] AS ([dbo].[getID_Departement_From_ID_Opleiding_COMPUTED_COLUMN]([ID_Opleiding])), CONSTRAINT [PK__kzlst_Opleiding___17F5F1ED] PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO ALTER TABLE [dbo].[kzlst_Opleiding_Voorzitter] ADD CONSTRAINT [DF_kzlst_Opleiding_Voorzitter_Geldig_Van] DEFAULT ('01/10/2009') FOR [Geldig_Van] GO ALTER TABLE [dbo].[kzlst_Opleiding_Voorzitter] ADD CONSTRAINT [DF_kzlst_Opleiding_Voorzitter_Geldig_Tot] DEFAULT ('31/12/2999') FOR [Geldig_Tot] GO SYNCRO SCRIPT (with ignore check constraints OFF and ignore identy increment OFF) SET NUMERIC_ROUNDABORT OFF GO SET ANSI_PADDING, ANSI_WARNINGS, CONCAT_NULL_YIELDS_NULL, ARITHABORT, QUOTED_IDENTIFIER, ANSI_NULLS ON GO USE [GPS] GO PRINT N'Disabling DDL triggers' GO DISABLE TRIGGER ALL ON DATABASE GO PRINT N'Dropping constraints from [dbo].[kzlst_Opleiding_Voorzitter]' GO ALTER TABLE [dbo].[kzlst_Opleiding_Voorzitter] DROP CONSTRAINT [PK__kzlst_Opleiding___17F5F1ED] GO PRINT N'Dropping constraints from [dbo].[kzlst_Opleiding_Voorzitter]' GO ALTER TABLE [dbo].[kzlst_Opleiding_Voorzitter] DROP CONSTRAINT [DF__kzlst_Opl__Geldi__60D0A58C] GO PRINT N'Dropping constraints from [dbo].[kzlst_Opleiding_Voorzitter]' GO ALTER TABLE [dbo].[kzlst_Opleiding_Voorzitter] DROP CONSTRAINT [DF__kzlst_Opl__Geldi__61C4C9C5] GO PRINT N'Rebuilding [dbo].[kzlst_Opleiding_Voorzitter]' GO CREATE TABLE [dbo].[tmp_rg_xx_kzlst_Opleiding_Voorzitter] ( [ID] [int] NOT NULL IDENTITY(1, 1), [ID_Opleiding] [int] NOT NULL, [ID_Opleidingsvoorzitter] [int] NOT NULL, [Geldig_Van] [datetime] NOT NULL DEFAULT ('01/10/2009'), [Geldig_Tot] [datetime] NOT NULL DEFAULT ('31/12/2999'), [GELDIG] AS (case when [Geldig_Van]<dateadd(day,(0),datediff(day,(0),getdate())) AND [geldig_Tot]>=dateadd(day,(0),datediff(day,(0),getdate())) then (1) else (0) end), [ID_Departement] AS ([dbo].[getID_Departement_From_ID_Opleiding_COMPUTED_COLUMN]([ID_Opleiding])) ) GO INSERT INTO [dbo].[tmp_rg_xx_kzlst_Opleiding_Voorzitter]([ID], [ID_Opleiding], [ID_Opleidingsvoorzitter], [Geldig_Van], [Geldig_Tot]) SELECT [ID], [ID_Opleiding], [ID_Opleidingsvoorzitter], [Geldig_Van], [Geldig_Tot] FROM [dbo].[kzlst_Opleiding_Voorzitter] GO DECLARE @idVal BIGINT SELECT @idVal = IDENT_CURRENT(N'[dbo].[kzlst_Opleiding_Voorzitter]') IF @idVal IS NOT NULL DBCC CHECKIDENT(N'[dbo].[tmp_rg_xx_kzlst_Opleiding_Voorzitter]', RESEED, @idVal) GO DROP TABLE [dbo].[kzlst_Opleiding_Voorzitter] GO EXEC sp_rename N'[dbo].[tmp_rg_xx_kzlst_Opleiding_Voorzitter]', N'kzlst_Opleiding_Voorzitter' GO PRINT N'Re-enabling DDL triggers' GO ENABLE TRIGGER trgNoRightJoins ON DATABASE GO :!: As you can see: * the constraints are not recreated under the same name (even if they were the same) * the primary key attribute is not recreated at all (even if it was there) Then I went back to the synchronisation option and found that ignore Identity property on columns was on SO if column on receiving end is allready an identity column and ignore identity property is ON the synchronisation fails Furthermore i changed 'ignore CONSTRAINT AND INDEX NAMES' to OFF SET NUMERIC_ROUNDABORT OFF GO SET ANSI_PADDING, ANSI_WARNINGS, CONCAT_NULL_YIELDS_NULL, ARITHABORT, QUOTED_IDENTIFIER, ANSI_NULLS ON GO USE [GPS] GO PRINT N'Disabling DDL triggers' GO DISABLE TRIGGER ALL ON DATABASE GO PRINT N'Dropping constraints from [dbo].[kzlst_Opleiding_Voorzitter]' GO ALTER TABLE [dbo].[kzlst_Opleiding_Voorzitter] DROP CONSTRAINT [PK__kzlst_Opleiding___17F5F1ED] GO PRINT N'Dropping constraints from [dbo].[kzlst_Opleiding_Voorzitter]' GO ALTER TABLE [dbo].[kzlst_Opleiding_Voorzitter] DROP CONSTRAINT [DF__kzlst_Opl__Geldi__60D0A58C] GO PRINT N'Dropping constraints from [dbo].[kzlst_Opleiding_Voorzitter]' GO ALTER TABLE [dbo].[kzlst_Opleiding_Voorzitter] DROP CONSTRAINT [DF__kzlst_Opl__Geldi__61C4C9C5] GO PRINT N'Rebuilding [dbo].[kzlst_Opleiding_Voorzitter]' GO CREATE TABLE [dbo].[tmp_rg_xx_kzlst_Opleiding_Voorzitter] ( [ID] [int] NOT NULL IDENTITY(1, 1), [ID_Opleiding] [int] NOT NULL, [ID_Opleidingsvoorzitter] [int] NOT NULL, [Geldig_Van] [datetime] NOT NULL CONSTRAINT [DF_kzlst_Opleiding_Voorzitter_Geldig_Van] DEFAULT ('01/10/2009'), [Geldig_Tot] [datetime] NOT NULL CONSTRAINT [DF_kzlst_Opleiding_Voorzitter_Geldig_Tot] DEFAULT ('31/12/2999'), [GELDIG] AS (case when [Geldig_Van]<dateadd(day,(0),datediff(day,(0),getdate())) AND [geldig_Tot]>=dateadd(day,(0),datediff(day,(0),getdate())) then (1) else (0) end), [ID_Departement] AS ([dbo].[getID_Departement_From_ID_Opleiding_COMPUTED_COLUMN]([ID_Opleiding])) ) GO SET IDENTITY_INSERT [dbo].[tmp_rg_xx_kzlst_Opleiding_Voorzitter] ON GO INSERT INTO [dbo].[tmp_rg_xx_kzlst_Opleiding_Voorzitter]([ID], [ID_Opleiding], [ID_Opleidingsvoorzitter], [Geldig_Van], [Geldig_Tot]) SELECT [ID], [ID_Opleiding], [ID_Opleidingsvoorzitter], [Geldig_Van], [Geldig_Tot] FROM [dbo].[kzlst_Opleiding_Voorzitter] GO SET IDENTITY_INSERT [dbo].[tmp_rg_xx_kzlst_Opleiding_Voorzitter] OFF GO DECLARE @idVal BIGINT SELECT @idVal = IDENT_CURRENT(N'[dbo].[kzlst_Opleiding_Voorzitter]') IF @idVal IS NOT NULL DBCC CHECKIDENT(N'[dbo].[tmp_rg_xx_kzlst_Opleiding_Voorzitter]', RESEED, @idVal) GO DROP TABLE [dbo].[kzlst_Opleiding_Voorzitter] GO EXEC sp_rename N'[dbo].[tmp_rg_xx_kzlst_Opleiding_Voorzitter]', N'kzlst_Opleiding_Voorzitter' GO PRINT N'Re-enabling DDL triggers' GO ENABLE TRIGGER trgNoRightJoins ON DATABASE GO It is still missing the PK constraint So i put the option 'ignore indexes' OFF :!: I thought the ignore options where there to not detect a difference between tables, I did not know the full impact on the synchronisation script. If the table is synchronized for another reason (column order) and theres a table rebuild, it should not throw away constraints that were allready there (but ignored for tablediff) / comments
Chris, 128 is returned I've tried it again with an other table creation script (SSMS) CREATE TABLE [dbo].[kzlst_Opleiding_Voorzitter]( [ID] [int] IDENTITY(1...
0 votes
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.g USE msdb; GO CREATE OR ALTER VIEW sysjobs_proxy AS SELECT * FROM msdb.dbo.sysjobs AS j; GO CREATE OR ALTER VIEW sysjobsteps_proxy AS SELECT st.*,        j.job_id AS j_job_id,        j.name AS job_name FROM dbo.sysjobsteps AS st     INNER JOIN dbo.sysjobs AS j         ON j.job_id = st.job_id; GO CREATE OR ALTER VIEW sysjobschedules_proxy AS SELECT jsc.*,        j.job_id AS j_job_id,        j.name AS job_name,        sc.name AS shedule_name,        sc.schedule_id AS sc_schedule_id FROM msdb.dbo.sysjobschedules AS jsc     INNER JOIN dbo.sysjobs AS j         ON j.job_id = jsc.job_id     INNER JOIN dbo.sysschedules AS sc         ON sc.schedule_id = jsc.schedule_id; GO CREATE OR ALTER VIEW sysschedules_proxy AS SELECT * 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' BEGIN DECLARE @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=1 END / comments
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 c...
0 votes