   print ('Step: DBCC DROPCLEANBUFFERS')
   DBCC DROPCLEANBUFFERS


   print ('Step: DBCC FREEPROCCACHE')
   DBCC FREEPROCCACHE


SELECT TOP 200
    Objects_Ir_Rel_tbl.IrId
   FROM
    Objects_tbl WITH (nolock)
    INNER JOIN Objects_Ir_Rel_tbl WITH (nolock) ON (Objects_tbl.Id = Objects_Ir_Rel_tbl.ObjectId)
   WHERE
     Objects_tbl.ObjectClass='DS'
-- AND Objects_tbl.ProcStateColRf = 'RUN.F'
-- AND Objects_tbl.ProcStateColRf like 'X%'
-- AND Objects_tbl.ProcStateColRf = 'N'
   AND Objects_tbl.ObjectFromSiteID ='TCP010' 
	AND Objects_tbl.ObjectOwningSiteID='TCP010'
	AND Objects_tbl.ObjectUgMaster_Type = 'AP'

 AND Objects_tbl.ObjectType IN ('UGMASTER','UGPART')
 AND Objects_tbl.ObjectUgMaster_APLevels<=3
 AND Objects_tbl.ObjectUgMaster_CompCount<=20000
 AND Objects_tbl.ObjectUgMaster_CompCount>=0
   ORDER BY
 Objects_tbl.ObjectUgMaster_APLevels ASC --, 
, Objects_tbl.ObjectUgMaster_CompCount ASC