Problem: SQL Compare tries to add existing column
seannerd
Posts: 3
SQL Compare 10.0.0.181 tries to add an existing column because the default constraint has a different name
In the script, I get these lines:
And, to add to it, after errors occur, it tries to drop the columns a few lines later presumably because it thought the script was adding them.
I think, what should have happened here is:
Is this a bug, or am I running this with a bogus setting?
Thanks.
- Sean
In the script, I get these lines:
PRINT N'Altering [dbo].[updates]' GO ALTER TABLE [dbo].[updates] ADD [settings] [int] NOT NULL CONSTRAINT [DF_updates_settings] DEFAULT ((0)), [settings_r] [int] NOT NULL CONSTRAINT [DF_updates_settings_r] DEFAULT ((0))But those two columns exist. Here is the compare screen shot of the difference before the script was generated:
And, to add to it, after errors occur, it tries to drop the columns a few lines later presumably because it thought the script was adding them.
I think, what should have happened here is:
alter table updates drop constraint DF__updates__Setting__405B5365 alter table updates add constraint DF_updates_settings default ((0)) for settings alter table updates drop constraint DF__updates__Setting__414F779E alter table updates add constraint DF_updates_settings_r default ((0)) for settings_r
Is this a bug, or am I running this with a bogus setting?
Thanks.
- Sean
Comments
I ran a test on a simple DB with one table, and SQL Compare did what I would expect, and dropped the original constraint, and re-added it with the new name.
So - I'm not sure what happened. But - I cannot mess with it anymore right now, unfortunately.
Thanks, Brian.
- Sean