Find Active Holds on Lost, Claimed, and Missing Items
Select
distinct CIR.ItemRecordID into #tempdb – Import data into temp before moving to recordset
from
polaris.polaris.SysHoldRequests as SHR with (nolock)
join
polaris.polaris.CircItemRecords as CIR with (nolock) on SHR.BibliographicRecordID = CIR.AssociatedBibRecordID
join
polaris.polaris.BibliographicRecords as BR with (nolock) on CIR.AssociatedBibRecordID = BR.BibliographicRecordID
where
CIR.ItemStatusID in (7,8,9,10) – Lost, Claimed Returned, Claimed Never Had, Missing
and
SHR.SysHoldStatusID = 3 – Hold Request Active
and CIR.AssignedCollectionID in () – Limit to a given collection if needed
insert into polaris.polaris.ItemRecordSets (RecordSetID, ItemRecordID)
select
1234, – This should be the same RecordSetID as above
itemrecordid
from
#tempdb – Insert into RecordSet
drop table #tempdb