You can create a temp table:
CREATE TABLE #temptblOrders(OrderID int)
... store all OrderIDs into this.
Use this temp table inside your proc as:
select * from tblOrders where OrderId in (select OrderID from #temptblOrders)
~Manoj (manub22@gmail.com)
http://sqlwithmanoj.wordpress.com
MCCA 2011