Bug: Insufficient error info w/dupe extended property defs
jalbert
Posts: 18
Consider the following trivial DDL:
When SQL Compare 6.2 goes to read the scripts, it will return an error "An item with the same key has already been added." It would be very helpful for the program to also report the text of the key that was duplicated, so that it's possible to search through the scripts to find the offending duplicate. The workaround is very tedious; it involves removing scripts until the Synchronization Wizard doesn't throw that exception. It'd be great if this could be addressed in the next point release of SQL Compare. Thanks!
CREATE TABLE dbo.Widgets ( widget_id UNIQUEIDENTIFIER NOT NULL ); -- The first extended property works fine. EXEC sys.sp_addextendedproperty N'MS_Description', N'The ID of the widget.', N'SCHEMA', N'dbo', N'TABLE', N'Widgets', N'COLUMN', N'widget_id'; -- Add an exact duplicate (on accident, of course) EXEC sys.sp_addextendedproperty N'MS_Description', N'The ID of the widget.', N'SCHEMA', N'dbo', N'TABLE', N'Widgets', N'COLUMN', N'widget_id';
When SQL Compare 6.2 goes to read the scripts, it will return an error "An item with the same key has already been added." It would be very helpful for the program to also report the text of the key that was duplicated, so that it's possible to search through the scripts to find the offending duplicate. The workaround is very tedious; it involves removing scripts until the Synchronization Wizard doesn't throw that exception. It'd be great if this could be addressed in the next point release of SQL Compare. Thanks!
Comments
Thanks for pointing that out, but I do not seem to be able to replicate the test case -- SQL Server 2005 does not let me run the second extended property into the database; it ends up throwing this error:
I don't think that SQL Compare does any validation against the SQL scripts when you synchronize from script files. I guess that is the root of the problem there.
What we'll do is to raise an issue in our bug tracking system with a suggestion to improve the error messaging. There's no doubt that we could be more helpful in this situation.
Thanks very much for your feedback!
David Atkinson
Red Gate Software
Product Manager
Redgate Software