IF NOT EXISTS
(
  SELECT SysColumns.Name 
  FROM SysObjects WITH (NOLOCK) 
    INNER JOIN SysColumns WITH (NOLOCK) ON SysColumns.Id = SysObjects.ID 
    AND SysColumns.Name = 'ParentPurposeCodeNumber'
    WHERE SysObjects.Name = 'PurposeCodes'
)
  ALTER TABLE PurposeCodes ADD ParentPurposeCodeNumber INT NULL 
GO
UPDATE PurposeCodes
SET ParentPurposeCodeNumber = PurposeCodeNumber
WHERE ParentPurposeCodeNumber IS NULL