I need to insert into 5 tables in a SQL Server database. I'm using the RDC, which is awesome!
Here is my scenario.
I need to insert into a table called Customer. The key is ID, which is an identity column. I have a stored procedure on the database I can use for this and it will return the ID created.
Once the customer is inserted and I have the ID for the new customer, I need to insert into 4 more tables, with the key for each table being the ID from the customer insert.
So, my questions are:
1. How do I call a stored procedure using RDC and DBRequestManager?
2. I'd like to make use of the "ExecuteBatch" command of DBRequestManager, as it is faster and will wrap all the inserts in a transaction. How do I do it, if I have to get the ID from the first insert to be used in the remaining 4 inserts? Again, I'd like to make use of stored procedures on the remote server, if I can.
Here is my scenario.
I need to insert into a table called Customer. The key is ID, which is an identity column. I have a stored procedure on the database I can use for this and it will return the ID created.
Once the customer is inserted and I have the ID for the new customer, I need to insert into 4 more tables, with the key for each table being the ID from the customer insert.
So, my questions are:
1. How do I call a stored procedure using RDC and DBRequestManager?
2. I'd like to make use of the "ExecuteBatch" command of DBRequestManager, as it is faster and will wrap all the inserts in a transaction. How do I do it, if I have to get the ID from the first insert to be used in the remaining 4 inserts? Again, I'd like to make use of stored procedures on the remote server, if I can.