tags:

views:

44

answers:

2

I'm trying to debug a stored procedure. I'm creating a logtable (just a regular table) and inserting the stored proc input values into it, however this is in the middle of transaction and my inserts are getting rolled back. Is there any way to commit my inserts that have them saved even when a rollback is issued.

Thanks

+1  A: 

Check out the SQL Server Profiler to see what is being passed into your procs...

klabranche
either that or a bunch of *print*s will do :)
JohnIdol
Yes, a bunch of prints will do it also. :)
klabranche
+3  A: 

In code if you are calling procedures in a nested fashion only the outermost BEGIN TRAN ... ROLLBACK TRAN will have the ability to create records that will not be rolled back. However, SQL Server Profiler allows you to see exactly what Transact-SQL statements are submitted to the server and how the server accesses the database to return result sets.

ahsteele