Update Pub_Grade set Depth = CASE WHEN GradeGuid IS NULL THEN 1 ELSE 2 END Update Pub_Press set Depth = CASE WHEN PressGuid IS NULL THEN 1 ELSE 2 END Update Pub_Category set Depth = CASE WHEN CategoryGuid IS NULL THEN 1 ELSE 2 END Update Pub_Channel set Depth = CASE WHEN ChannelGuid IS NULL THEN 1 ELSE 2 END