I have 2 stored procs:
The GetActiveSuppliers takes no input parameters and simply returns 3 columns:
The 2nd stored proc, GetOrderStatus, is more involved and returns a bunch of data based on a single parameter - SupplierID.
Today, I was asked to generate a master Order Status Report based on ALL Suppliers.
To do that, I've cloned the GetOrderStatus into a new stored proc called GetOrderStatusAll.
Rather than pass in a single supplier ID, I'd like it to use ALL the SupplierIDs from the results of GetActiveSuppliers proc above
However, I don't need the SupplierName and SupplierEmail columns, just the SupplierID.
I've changed the WHERE clause so it will read as:
WHERE SUPPLIERID IN
The tricky part is I'm not sure how to call that GetActiveSuppliers proc from within this new stored proc and explicitly pass a comma-separated list of just supplier IDs into the new stored proc's Where clause.
Any thoughts? Thanks!