December 27, 2011 at 2:51 am
I think I will answer my own last question. The answer is that usually a sproc would not be used to update multiple tables at one time, however if it were used, it could easily contain two sql statements executed one after another, contained in conditional statements.
Here's a link that helped me.
December 27, 2011 at 5:28 am
hxkresl (12/27/2011)
I think I will answer my own last question. The answer is that usually a sproc would not be used to update multiple tables at one time, however if it were used, it could easily contain two sql statements executed one after another, contained in conditional statements.Here's a link that helped me.
It’s not entirely true. Stored Procedure is set of T-SQL statements. It can have multiple DML statements inside. Having a conditional statement (say IF) in it is absolutely business requirements, not a mandate.
You can have a stored procedure like this...
CREATE PROCEDURE P
AS
INSERT INTO TAB_A
VALUES (1,’A’)
INSERT INTO TAB_B
VALUES (1,1,’A’)
Viewing 2 posts - 16 through 16 (of 16 total)
You must be logged in to reply to this topic. Login to reply