Is there a way to show part numbers that have been obsoleted?

Part numbers are not automatically removed from the database (to keep a history), but they are marked “deleted” (with a delete date) when they no longer appear in the import script.

The script below will show all part numbers that have been marked deleted. Near the top of the script is the line:

set @Cutoff = '2018-01-01'

Any parts that were deleted before the date on that line will be displayed. You can change the date as needed.

BEGIN
    DECLARE @Cutoff DATETIME = '2018-01-01';

    SELECT DISTINCT 
           b.BrandNm, 
           pb.PartNumber
    FROM PartBrand pb
    INNER JOIN Brand b 
        ON b.BrandID = pb.BrandID
    WHERE EXISTS (
        SELECT 1
        FROM PartBrandHistory pbh
        WHERE pbh.MaintType = 'D'
          AND pbh.PID = pb.PID
          AND pbh.BrandID = pb.BrandID
          AND pbh.MaintDate < @Cutoff
          AND NOT EXISTS (
              SELECT 1
              FROM PartBrandHistory pbh0
              WHERE pbh0.PID = pbh.PID
                AND pbh0.BrandID = pbh.BrandID
                AND pbh0.MaintDate > pbh.MaintDate
          )
    );
END

You can manually remove part numbers, however, using the Primary/Trading Partner Brand Maintenance screen. There are two options on that screen (for the selected brand row).

Delete All Parts will physically delete all parts for the brand. If no other brand references the primary brand part, the PartMaster records will also be deleted. This is useful if you want a clean start for a brand. The only thing you lose is net changes.

Purge Deleted Parts will remove just those parts that have been marked as deleted. PartMaster records will also be deleted if not referenced by another brand.

Run or Test Run of a script will report which parts were deleted by the script.

Revised: 2010-05-04