I have a procedure that accepts parameter @Data of type xml and updates an order in order table.
I have to call this procedure in a SSRS report for any order that need to be updatad and update the order table from one source table. Right now I have a CTE that lists all the orderIds that need to be updated in order table from this report.
lets say the CTE returns orderIds: 1234, and 4567.
The following two lines will update order 1234 in the order table.
@XmlData XML = (select MyScalarValueFunction('1234'))
execute UpdateProcedure @Data = @XmlData
and lets say the report data set query selects all requests from customers and if customer order has been processed, I want to update the orderId in the table.
select c.CustomerName, c.OrderId from CustomerDemandsTable c
My challenge is: how can I incorporate the two line for updating the table in my report data set query for each order.
I have done updating tables from SSRS data set before. But over there each time I updated the whole table all at once and I did not have to declare any parameter and to call the update procedure in the middle of the query.
Any help is much appreciated.