• You will not get the results you want if the values are NULL.

    When I compare tables I use a CHECKSUM.

    SELECT

    *

    FROM

    (SELECT

    [compareHR].[dbo].[TableOLD].[Pos_no],

    CHECKSUM(*) AS XSum

    FROM

    [compareHR].[dbo].[TableOLD]) AS Old

    FULL JOIN

    (SELECT

    [compareHR].[dbo].[TableNEW].[Pos_no],

    CHECKSUM(*) AS XSum

    FROM

    [compareHR].[dbo].[TableNEW]) AS New

    WHERE

    Old.Pos_no IS NULL -- Row doesn't exist in old table

    OR New.Pos_no IS NULL -- Row doesn't exist in new table

    OR Old.XSum <> New.XSum; -- Row is different

    The SQL Guy @ blogspot[/url]

    @SeanPearceSQL

    About Me[/url]