Generated DBCC CheckIdent statements missing Schema

findtimfindtim 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'

Comments

  • Thank you for your post.

    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.
  • I am still seeing the issue. I removed all references to RedGate dlls in my project and re Added the references to these dlls:

    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?
  • Brian DonahueBrian Donahue Posts: 6,590 New member
    This fix is supposed to be in SQL Compare Engine 8.2.1.13, so your version falls a bit short of the mark. I suppose what you could do is get a copy of SQL Compare 8.5 from the website and copy all of the DLLs into your SDK references folder.
  • That sounds like a great solution, unfortunately RedGate has taken certain precautions in building your dlls so that the Engine dll from the compare tool itself does not expose any public interface like the SDK version does. When when I try this the Imports RedGate.SQLCompare.Engine statment tells me:
    Namespace or type specified in the Imports 'RedGate.SQLCompare.Engine' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.

    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
  • So am I to run with the impression that RedGate has stopped supporting SDK 8? This is a bug it needs to be fixed. You already have the code to fix it, but it has not been released.


    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
Sign In or Register to comment.