Generated DBCC CheckIdent statements missing Schema
findtim
Posts: 10
The code the engine generates to sync two databases is missing the schema name when a table change occurs with an identity column.
Am I missing something in the documentation on how to address this?
Or are there any plans to fix this issue?
Thank you for your help.
This is the code that is generated with the BOLD peices missing:
INSERT INTO [MySchema].[tmp_rg_xx_MyTable]([MyColumn]) SELECT [MyColumn] FROM [MySchema].[MyTable]
GO
@TRANCOUNT>0 ROLLBACK TRANSACTION
GO
@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
GO
SET IDENTITY_INSERT [MySchema].[tmp_rg_xx_MyTable] OFF
GO
@TRANCOUNT>0 ROLLBACK TRANSACTION
GO
@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
GO
DECLARE @idVal INT
SELECT @idVal = IDENT_CURRENT(N'MySchema.MyTable')
DBCC CHECKIDENT('[MySchema].[tmp_rg_xx_MyTable]', RESEED, @idVal)
GO
@TRANCOUNT>0 ROLLBACK TRANSACTION
GO
@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
GO
DROP TABLE [MySchema].[MyTable]
GO
@TRANCOUNT>0 ROLLBACK TRANSACTION
GO
@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
GO
EXEC sp_rename N'[MySchema].[tmp_rg_xx_MyTable]', N'MyTable'
Am I missing something in the documentation on how to address this?
Or are there any plans to fix this issue?
Thank you for your help.
This is the code that is generated with the BOLD peices missing:
INSERT INTO [MySchema].[tmp_rg_xx_MyTable]([MyColumn]) SELECT [MyColumn] FROM [MySchema].[MyTable]
GO
@TRANCOUNT>0 ROLLBACK TRANSACTION
GO
@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
GO
SET IDENTITY_INSERT [MySchema].[tmp_rg_xx_MyTable] OFF
GO
@TRANCOUNT>0 ROLLBACK TRANSACTION
GO
@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
GO
DECLARE @idVal INT
SELECT @idVal = IDENT_CURRENT(N'MySchema.MyTable')
DBCC CHECKIDENT('[MySchema].[tmp_rg_xx_MyTable]', RESEED, @idVal)
GO
@TRANCOUNT>0 ROLLBACK TRANSACTION
GO
@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
GO
DROP TABLE [MySchema].[MyTable]
GO
@TRANCOUNT>0 ROLLBACK TRANSACTION
GO
@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
GO
EXEC sp_rename N'[MySchema].[tmp_rg_xx_MyTable]', N'MyTable'
Comments
The cumulative patch which can be found on this post should fix this problem:
http://www.red-gate.com/messageboard/vi ... php?t=9911
Please let me know if it does not.
RedGate.Shared.SQL 8.0.0.21
RedGate.Shared.Utils 8.0.0.21
RedGate.SQLCompare.Engine 8.2.1.7
Are those the version numbers you would expect after I added the patch?
Shared.Utils and Shared.SQL work fine.
Thoughts?
As was posted by chrisk5 - I did install the patch, but the versions of the assemblies did not change in the SDK directory. You can see the version number post install in my above post. And as I just layed out, I am not allowed to use the SQL Compare dlls it appears.
Are there any plans to rebuild the SDK with the necessary fixes and post and additional patch?
Thanks,
Tim
Please release the code. It is really hard to sell a solution to management when there is a vendor bug that keeps it from working.
Thanks,
Tim