Red Gate forums :: View topic - Logic flaw
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Compare 10
SQL Compare 10 forum

Logic flaw

Search in SQL Compare 10 forum
Post new topic   Reply to topic
Jump to:  
Author Message
tcorrigan5



Joined: 08 Feb 2014
Posts: 1

PostPosted: Mon Feb 10, 2014 10:50 pm    Post subject: Logic flaw Reply with quote

Seems like there is a logic flaw in your script creation. Script is trying to rebuild the Shipments table with the following code

Code:
PRINT N'Rebuilding [dbo].[Shipments]'
GO
CREATE TABLE [dbo].[tmp_rg_xx_Shipments]
(
[shipmentkey] [int] NOT NULL IDENTITY(1, 1),
[orderkey] [int] NOT NULL CONSTRAINT [DF_Shipments_orderkey] DEFAULT ((0)),
[bolkey] [int] NOT NULL CONSTRAINT [DF_Shipments_bolkey] DEFAULT ((0)),
[shipno] [char] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_Shipments_shipno] DEFAULT (''),
[type] [char] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_Shipments_type] DEFAULT (''),
[quantity] [int] NOT NULL CONSTRAINT [DF_Shipments_quantity] DEFAULT ((0)),
[nopkg] [int] NOT NULL CONSTRAINT [DF_Shipments_nopkg] DEFAULT ((0)),
[noreels] [int] NOT NULL CONSTRAINT [DF_Shipments_noreels0] DEFAULT ((0)),
[skids] [int] NOT NULL CONSTRAINT [DF_Shipments_skids] DEFAULT ((0)),
[freight] [smallmoney] NOT NULL CONSTRAINT [DF_Shipments_freight] DEFAULT ((0)),
[grosswt] [numeric] (10, 2) NOT NULL CONSTRAINT [DF_Shipments_grosswt] DEFAULT ((0)),
[netwt] [numeric] (10, 2) NOT NULL CONSTRAINT [DF_Shipments_netwt] DEFAULT ((0)),
[entered] [smalldatetime] NOT NULL CONSTRAINT [DF_Shipments_entered] DEFAULT (''),
[readied] [smalldatetime] NOT NULL CONSTRAINT [DF_Shipments_readied] DEFAULT (''),
[assigned] [smalldatetime] NOT NULL CONSTRAINT [DF_Shipments_assigned] DEFAULT (''),
[shipped] [smalldatetime] NOT NULL CONSTRAINT [DF_Shipments_shipped] DEFAULT (''),
[readiedby] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_Shipments_readiedby] DEFAULT (''),
[notified] [smalldatetime] NOT NULL CONSTRAINT [DF_Shipments_notifed] DEFAULT ('')
)
GO

Problem is that the Shipments table still exists and hence the constraints on the Shipments still exist but the CREATE TABLE statement is using the same constraint names. SQL Server throws an error about duplicate constraint names.
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6674

PostPosted: Thu Feb 13, 2014 1:36 pm    Post subject: Reply with quote

Thanks for contacting us. I believe this is a known issue (SC-6439) and I will reply to you privately with a patch that I think may fix this.

For future reference, this should be fixed in the next release (10.5?) so in the future if you have this problem in v10.5+, please disregard this forum topic.
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