比较两个记录集是否相等

    技术2022-05-11  28

    IF  (        SELECT CHECKSUM_AGG(BINARY_CHECKSUM(*))        FROM   (                    -- first resultset to compare                    SELECT  *                     FROM    Person.Address               ) t1    )    =             (        SELECT CHECKSUM_AGG(BINARY_CHECKSUM(*))        FROM   (                    -- second resultset to compare                    SELECT  *                     FROM    Person.Address                    WHERE   AddressID < 1000                 ) t1    )    BEGIN        SELECT 'Resultsets equal'    ENDELSE    BEGIN        SELECT 'Resultsets NOT equal'      END


    最新回复(0)