Bug: Insufficient error info w/dupe extended property defs

jalbertjalbert Posts: 18
edited December 4, 2007 7:29AM in SQL Compare Previous Versions
Consider the following trivial DDL:
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

  • Brian DonahueBrian Donahue Posts: 6,590 New member
    Hi James,

    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:
    Msg 15233, Level 16, State 1, Procedure sp_addextendedproperty, Line 37
    Property cannot be added. Property 'MS_Description' already exists for 'dbo.Widgets.widget_id'.
  • The problem isn't when those statements are run on SQL Server 2005. The problem happens when SQL Compare 6.2 attempts to synchronize a script that contains the code.
  • Brian DonahueBrian Donahue Posts: 6,590 New member
    Hi,

    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.
  • Hi,

    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
    David Atkinson
    Product Manager
    Redgate Software
Sign In or Register to comment.