Generated DBCC CheckIdent statements missing Schema

Automate and integrate using the SQL comparison API

Moderator: Chris Auckland

Generated DBCC CheckIdent statements missing Schema

Postby findtim » Mon Mar 14, 2011 6:00 pm

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
IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
GO
IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
GO
SET IDENTITY_INSERT [MySchema].[tmp_rg_xx_MyTable] OFF
GO
IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
GO
IF @@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
IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
GO
IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
GO
DROP TABLE [MySchema].[MyTable]
GO
IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
GO
IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
GO
EXEC sp_rename N'[MySchema].[tmp_rg_xx_MyTable]', N'MyTable'
findtim
 
Posts: 8
Joined: Tue Jan 18, 2011 8:48 pm

Postby chriskelly » Tue Mar 15, 2011 9:45 pm

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.
chriskelly
 
Posts: 330
Joined: Mon Apr 19, 2010 1:44 pm
Location: Cambridge, UK

What version should I be looking for?

Postby findtim » Thu Mar 17, 2011 4:47 pm

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?
findtim
 
Posts: 8
Joined: Tue Jan 18, 2011 8:48 pm

Postby Brian Donahue » Thu Mar 17, 2011 5:56 pm

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.
Brian Donahue
 
Posts: 6668
Joined: Mon Aug 23, 2004 10:48 am

Postby findtim » Fri Mar 18, 2011 6:22 pm

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
findtim
 
Posts: 8
Joined: Tue Jan 18, 2011 8:48 pm

Postby findtim » Mon Apr 18, 2011 4:41 pm

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
findtim
 
Posts: 8
Joined: Tue Jan 18, 2011 8:48 pm


Return to SQL Comparison SDK Previous Versions

Who is online

Users browsing this forum: No registered users and 0 guests