Red Gate forums :: View topic - Bug or oversight? - or am I missing something
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

Bug or oversight? - or am I missing something

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



Joined: 02 Feb 2012
Posts: 2

PostPosted: Thu Feb 02, 2012 4:51 pm    Post subject: Bug or oversight? - or am I missing something Reply with quote

Hi

I have at last managed to get a full license for the products and am now using them.

I have come across a bit of a problem today when deploying some changes to our live environment.

I added a new column to a table and inserted before the last 3 columns ie.


CREATE TABLE [dbo].[JobsArchive]
(
[Id] [int] NOT NULL,
[Description] [nvarchar] (max) COLLATE Latin1_General_CI_AS NULL,
[JobAssetSetId] [int] NOT NULL,
[Category] [nvarchar] (15) COLLATE Latin1_General_CI_AS NOT NULL,
[AccountCodeId] [int] NOT NULL,
[CostCentreId] [int] NULL,
[HealthandSafety] [bit] NOT NULL,
[ContractorId] [int] NULL,
[SpecId] [int] NULL,
[RaisedOn] [datetime] NOT NULL,
[Priority] [int] NOT NULL,
[TargetDate] [datetime] NULL,
[DefectId] [int] NULL,
[SafetyRequired] [bit] NOT NULL CONSTRAINT [DF_JobsArchive_SafetyRequired] DEFAULT ((0)),
[JobSafetySetId] [int] NULL,
[JobCPBSSafetyId] [int] NULL,
[IssuedDate] [datetime] NULL,
[ContractorComplete] [bit] NULL,
[ContractorCompDate] [datetime] NULL,
[FinanceComplete] [bit] NULL,
[FinanceCompDate] [datetime] NULL,
[FinanceComments] [nvarchar] (max) COLLATE Latin1_General_CI_AS NULL,
[InvoiceNo] [varchar] (20) COLLATE Latin1_General_CI_AS NULL,
[Active] [bit] NOT NULL CONSTRAINT [DF_JobsArchive_Active] DEFAULT ((1)),
[DateChanged] [datetime] NOT NULL,
[ChangedBy] [nvarchar] (50) COLLATE Latin1_General_CI_AS NOT NULL
)

Notice the InvoiceNo field

Compare shows no differences , yet if I look at the matching tables etc i see the target as

CREATE TABLE [dbo].[JobsArchive]
(
[Id] [int] NOT NULL,
[Description] [nvarchar] (max) COLLATE Latin1_General_CI_AS NULL,
[JobAssetSetId] [int] NOT NULL,
[Category] [nvarchar] (15) COLLATE Latin1_General_CI_AS NOT NULL,
[AccountCodeId] [int] NOT NULL,
[CostCentreId] [int] NULL,
[HealthandSafety] [bit] NOT NULL,
[ContractorId] [int] NULL,
[SpecId] [int] NULL,
[RaisedOn] [datetime] NOT NULL,
[Priority] [int] NOT NULL,
[TargetDate] [datetime] NULL,
[DefectId] [int] NULL,
[SafetyRequired] [bit] NOT NULL CONSTRAINT [DF_JobsArchive_SafetyRequired] DEFAULT ((0)),
[JobSafetySetId] [int] NULL,
[JobCPBSSafetyId] [int] NULL,
[IssuedDate] [datetime] NULL,
[ContractorComplete] [bit] NULL,
[ContractorCompDate] [datetime] NULL,
[FinanceComplete] [bit] NULL,
[FinanceCompDate] [datetime] NULL,
[FinanceComments] [nvarchar] (max) COLLATE Latin1_General_CI_AS NULL,
[Active] [bit] NOT NULL CONSTRAINT [DF_JobsArchive_Active] DEFAULT ((1)),
[DateChanged] [datetime] NOT NULL,
[ChangedBy] [nvarchar] (50) COLLATE Latin1_General_CI_AS NOT NULL,
[InvoiceNo] [varchar] (20) COLLATE Latin1_General_CI_AS NULL
)
GO

You will notive InvoiceNo is placed at the end!! , it has to be before Active because there is a sproc that copies the Jobs table rows into the Archive using

INSERT dbo.JobsArchive
SELECT * ,
GETDATE() ,
@ChangedBy
FROM dbo.Jobs
WHERE Id = @Id

which now fails until i move the InvoiceNo field to the correct position.

Is this a bug or am i missing something. Why does SQL Compare not show it as a difference ?

P.S.

BTW Your forum is frustratingly slow!!!!!!![/img]
Back to top
View user's profile Send private message
David Atkinson



Joined: 05 Dec 2005
Posts: 1124
Location: Twitter: @dtabase

PostPosted: Thu Feb 02, 2012 7:16 pm    Post subject: Reply with quote

Have you tried the "Force column order" option in Edit Project/Options/Behavior?

Let us know if this works for you.

Kind regards,

David Atkinson
Red Gate

PS Yes, the forum responsiveness can be quite temperamental! Sorry.
Back to top
View user's profile Send private message Send e-mail
BTP



Joined: 02 Feb 2012
Posts: 2

PostPosted: Fri Feb 03, 2012 9:58 am    Post subject: Reply with quote

Ah, found it...

Might i suggest that this should actually be a default.

I personally dont understand why you wouldnt want to preserve the order!

Forum got faster shortly after I posted Smile
_________________
Darren Lawrence
Developer
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