Invalid Index specification leads to exception

Forum for users of SQL Compare schema synchronization utility

Invalid Index specification leads to exception

Postby urs.meili » Wed Feb 20, 2013 7:46 am

I have the following SQL script which SQL Compare is processing using the "compare with files" option:

CREATE TABLE [dbo].[tblMutationHistory]
[IDMutationHistory] [int] NOT NULL IDENTITY(1, 1),
[MHistObjArt] [smallint] NOT NULL,
[MHistObjKey1] [int] NOT NULL,
[MHistObjKey2] [int] NULL,
[MHistTimeStamp] [datetime] NOT NULL DEFAULT (getdate()),
[MHistIdBenutzer] [varchar] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[MHistGrund] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[MHistMutation] [nvarchar](max) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[MHistObjKey3] [int] NULL,
[MHistGuid] [uniqueidentifier] NULL -- Eindeutige GUID für diesen Mutationhistory-Eintrag
ALTER TABLE [dbo].[tblMutationHistory] ADD CONSTRAINT [PK__MutationHistory__3521D83F] PRIMARY KEY CLUSTERED ([IDMutationHistory])
CREATE NONCLUSTERED INDEX [MHistObjArt] ON [dbo].[tblMutationHistory] ([MHistObjArt])
CREATE NONCLUSTERED INDEX [MHistObjKey1] ON [dbo].[tblMutationHistory] ([MHistObjKey1])
CREATE NONCLUSTERED INDEX [MHist_GuidMutationHistory] ON [dbo].[tblMutationHistory] ([GuidMutationHistory])

This results in an exception "Failed to compare two elements in the array." within SQL Compare 10 (API).

The reason seems to be that the field in the index [MHist_GuidMutationHistory] is wrongly named ("[GuidMutationHistory]" instead of "[MHistGuid]".

I corrected the error in the script. However, it would be a good idea if SQL Compare would print a decent error message instead of just quitting with an arbitrary exception.
Posts: 9
Joined: Tue Jan 13, 2009 12:50 pm

Postby Manfred.Castro » Tue Feb 26, 2013 9:46 pm

Thank you for reporting this issue to us.
I have logged your issue in our bug tracking system under the internal reference number SC-6223.
Manfred Castro
Product Support
Red Gate Software
Posts: 209
Joined: Mon Apr 23, 2012 1:49 pm

Return to SQL Compare Previous Versions

Who is online

Users browsing this forum: No registered users and 2 guests