Toad World® Forums

Schema Compare Bug - Multiple Default Constraints


#1

Performing a Schema Compare on a single object. The resulting script attempts to temporarily add two default constraints on a single column which produces an error.

Source object:

CREATE TABLE [dbo].[Product] (
[aa] varchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[bb] decimal(12, 2),
[cc] decimal(12, 2),
[dd] decimal(12, 2),
[ee] datetime2(0),
[ff] smallint,
[gg] bit NOT NULL CONSTRAINT [DF_Product_gg] DEFAULT ((0)),
[hh] bit NOT NULL CONSTRAINT [DF_Product_hh] DEFAULT ((0)),
CONSTRAINT [PK_Product_aa] PRIMARY KEY([aa]) WITH (FILLFACTOR=100) ON [PRIMARY]
) ON [PRIMARY]

Target object:

CREATE TABLE [dbo].[Product] (
[aa] varchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[bb] decimal(12, 2),
[cc] decimal(12, 2),
[dd] decimal(12, 2) NOT NULL DEFAULT ((0.00)),
[ee] datetime2(7),
[ff] smallint,
[gg] bit,
CONSTRAINT [PK__Product__ABD942DE4C922A3B] PRIMARY KEY([aa]) WITH (FILLFACTOR=100) ON [PRIMARY]
) ON [PRIMARY]

Offending Block from resulting script:

Line 44:

ALTER TABLE [dbo].[Product]
ADD [gg] bit NOT NULL CONSTRAINT [DF_Product_gg] DEFAULT ((0)) CONSTRAINT [tmp_5892cdf055304782b7dd291cfa00962e] DEFAULT (((0))),
[hh] bit NOT NULL CONSTRAINT [DF_Product_hh] DEFAULT ((0))


#2

Hi,

Thank you very much for your posting. I create TSS-1207 for this issue and we will disscuss about it.

Thanks again,

Kelly


#3

Hi,

This issue has been fixed.

Kelly