select distinct ownerId, ownerType from tbl_SPL_Opportunities with (nolock) where archived = 'Y' and ownerId > 0 select top 10000 ownerId, ownerType, opportunityId from tbl_SPL_Opportunities with (nolock) where ownerId = and ownerType = and archived = 'Y' update tbl_SPL_Opportunities set ownerId = , ownerType = where ownerId = and ownerType = and opportunityId = select top 10000 ownerId, ownerType, opportunityId from tbl_SPL_Opportunities with (nolock) where ownerId = and ownerType = and archived = 'Y'