Red Gate forums :: View topic - Generated DBCC CheckIdent statements missing Schema
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Comparison SDK Previous Versions
SQL Comparison SDK Previous Versions forum

Generated DBCC CheckIdent statements missing Schema

Search in SQL Comparison SDK Previous Versions forum
Post new topic   Reply to topic
Jump to:  
Author Message
findtim



Joined: 18 Jan 2011
Posts: 8

PostPosted: Mon Mar 14, 2011 6:00 pm    Post subject: Generated DBCC CheckIdent statements missing Schema Reply with quote

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'
Back to top
View user's profile Send private message
chriskelly



Joined: 19 Apr 2010
Posts: 309
Location: Cambridge, UK

PostPosted: Tue Mar 15, 2011 9:45 pm    Post subject: Reply with quote

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/viewtopic.php?t=9911

Please let me know if it does not.
Back to top
View user's profile Send private message
findtim



Joined: 18 Jan 2011
Posts: 8

PostPosted: Thu Mar 17, 2011 4:47 pm    Post subject: What version should I be looking for? Reply with quote

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?
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6586

PostPosted: Thu Mar 17, 2011 5:56 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
findtim



Joined: 18 Jan 2011
Posts: 8

PostPosted: Fri Mar 18, 2011 6:22 pm    Post subject: Reply with quote

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:

Quote:
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
Back to top
View user's profile Send private message
findtim



Joined: 18 Jan 2011
Posts: 8

PostPosted: Mon Apr 18, 2011 4:41 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group