• This will deduplicate the rows that have missing values. However, if the duplicate rows are the majority, I might use a different approach.

    INSERT INTO @DiamondsMissingData

    SELECT '6157560941C','Crown','CR50135','GIA',6157560941,35588000,177940,NULL UNION ALL

    SELECT '6157560941C','Crown','CR50135','GIA',6157560941,35588000,NULL,27375500 UNION ALL

    SELECT '6157560941C','Crown','CR50135','GIA',6157560941,NULL,177940,27375500

    INSERT INTO @DiamondsWithData

    SELECT SKU

    ,VendorNumber

    ,VendorSKU

    ,GradingReportType

    ,GradingReportNumber

    ,MAX( Price)

    ,MAX( Cost)

    ,MAX( SalePrice)

    FROM @DiamondsMissingData

    WHERE Price IS NULL

    OR Cost IS NULL

    OR SalePrice IS NULL

    GROUP BY SKU

    ,VendorNumber

    ,VendorSKU

    ,GradingReportType

    ,GradingReportNumber

    DELETE FROM @DiamondsMissingData

    WHERE Price IS NULL

    OR Cost IS NULL

    OR SalePrice IS NULL

    INSERT INTO @DiamondsMissingData

    SELECT *

    FROM @DiamondsWithData

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2