• The table I'm working with is acutally a temporary table I've created from the source data which has been quite processed to get it to this point.

    The table definition below will give you a table which matches the data I posted and has the appropriate PK.

    The column called Seq is one I've added for convenience of processing (makes it able to do previous row, next row processing)

    CREATE TABLE [EUB\CB238].[TEMP](

    [HOLEID] [varchar](13) NOT NULL,

    [EvalNum] [int] NOT NULL,

    [Seq] [int] NOT NULL,

    [TopDepth] [numeric](6, 2) NOT NULL,

    [BaseDepth] [numeric](6, 2) NOT NULL,

    [MBit] NUMERIC(6,2) NULL,

    [PHIE] NUMERIC(6,2) NULL,

    [SwE] NUMERIC(6,2) NULL,

    [Vsh] NUMERIC(6,2) NULL,

    [Length] [numeric](6, 2) NULL,

    [OreFlag] [varchar](1)

    )

    CREATE UNIQUE CLUSTERED INDEX TEMP_PK ON TEMP(HoleId, EvalNum, TopDepth)