How can we help you today? How can we help you today?
BruceBau

Activity overview

Latest activity by BruceBau

It is not an Sql Server requirement that the primary key be the clustered index, and indeed there may be very good reasons for the clustered index to be something other than the primary key. The obvious solution for us is to make the clustered index for the two compared tables to be the same (along with the primary key) but there are timing considerations that do not allow us to do this now. It would seem that since the primary key makes each record unique, that that would be all you would need. I can see that having the two tables have the same physical organization ( clustered index) would make the comapre easier to do, but setting the primary key manually in the compare operation does not prevent the process from comparing successfully. Here is a script where the primary key is nonclustered. USE [AtlasSEA] GO /****** Object: Table [dbo].[TrevorTEST] Script Date: 02/02/2010 08:14:23 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[TrevorTEST]( [ID] [int] IDENTITY(1,1) NOT FOR REPLICATION NOT NULL, [TrevorTypeID] [int] NOT NULL, [Name] [varchar](100) NOT NULL, [SortName] [varchar](100) NOT NULL, CONSTRAINT [piTrevor] PRIMARY KEY NONCLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [AtlasDB] ) ON [PRIMARY] GO SET ANSI_PADDING OFF GO / comments
It is not an Sql Server requirement that the primary key be the clustered index, and indeed there may be very good reasons for the clustered index to be something other than the primary key. The o...
0 votes
Unnecessary manual setting of comparison key - Data compare
Data compare requires me to set comparison key manually when clustered index in the two tables is different even though both tables have identical primary key.
2 followers 10 comments 0 votes