How to find out which stored procedure is recompiling? How to stop stored procedures from recompiling?
• I have Two Stored Procedures SP1 and SP2 as given below. How the Transaction works, whether SP2 Transaction succeeds or fails? CREATE PROCEDURE SP1 AS BEGIN TRAN INSERT INTO MARKS (SID,MARK,CID) VALUES (5,6,3) EXEC SP2 ROLLBACK GO CREATE PROCEDURE SP2 AS BEGIN TRAN INSERT INTO MARKS (SID,MARK,CID) VALUES (100,100,103) commit tran GO Both will get roll backed. • CREATE PROCEDURE SP1 AS BEGIN TRAN INSERT INTO MARKS (SID,MARK,CID) VALUES (5,6,3) BEGIN TRAN INSERT INTO STUDENT (SID,NAME1) VALUES (1,’SA’) commit tran ROLLBACK TRAN GO Both will get roll backed.
Related Questions
- I select one stored procedure for synchronization, but there appear commands for changing several tables and stored procedures in the synchronization script. Why?
- How to find out which stored procedure is recompiling? How to stop stored procedures from recompiling?
- What is a Lip Enhancement procedure?