views:

72

answers:

2

Within a transaction is there a way to have data committed within it even though the transaction is rolled back? We're writing audit/logging information inside a transaction but we want to keep that information even though the transaction has to roll back.

We've see an article that tries to copy the Oracle way but what we're really looking for is some in-built SQL Server support (and was hoping for something like a 'not supported' option for a sproc or a 'suspend transaction' command.) Google searches have been a bit hopeless hence this post.

A: 

Unfortunately, this may be the only way but for SQL Server 2008, but it does mention options for SQL Server 2005

How to create an autonomous transaction in SQL Server 2008

gbn
A: 

Microsoft considered the idea in a simpler approach for 2008 and then dropped it:

http://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=296870

but there is another work around on their website.