| | |
commiting inner query while outer transaction is rollbacked
Please support our MS SQL advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: May 2009
Posts: 5
Reputation:
Solved Threads: 0
I have written a complex stored procedure which have a log table which keeps the track of success/failure of each and every query in the stored procedure. If there is any error in any of the query entire transaction is rollback . while rollingback, data in log table is also rollback .so if anybody plz suggest a way to commit the log file while rollbacking of outer loop.
thanks in advance
MS SQL Syntax (Toggle Plain Text)
CREATE PROCEDURE TEST AS BEGIN TRY BEGIN TRANS T1 UPDATE TABLE1 SET MyColumn = 'ABC' -- SOME QUERY --SOME QUERY --SOME QUERY BEGIN TRANS T2 --UPDATE IN LOG TABLE COMMIT TRANS T2 --SOME QUERY --SOME QUERY END TRY BEGIN CATCH ROLBACK TRANS T1 END CATCH COMMIT TRANS T1 GO
thanks in advance
Try putting your log query in
exec('query here') and see if that rolls back. I think that may be a work around but I haven't tested it before. ![]() |
Similar Threads
- [req] how to check whether given oracle table exist or not + C# (C#)
- I would like to get the result for a particular query using cursor in transaction (MS SQL)
- multiple left outer joins on query of query (ColdFusion)
- find which tables get updated.. (Oracle)
- PHP Object (PHP)
- SQL Queries help (Database Design)
- COM aggregation (C++)
- Query with Joins (Database Design)
- Query conversion from Sybase to MS SQL Server 2000 (MS SQL)
- to write a query (Database Design)
Other Threads in the MS SQL Forum
- Previous Thread: Update Different Groups of Data
- Next Thread: SQL Query takes lot of time
| Thread Tools | Search this Thread |






