I want to implement a simple debug log, which consists of a table into which I insert insightful messages about the current state of a transaction. How do I stop inserts to this table being affected by rollbacks on the transaction that I'm trying to debug? In Oracle I can use PRAGMA AUTONOMOUS_TRANSACTION
to ensure that the inserts are done outside of the transaction, but what are my options in T-SQL? How do you implement logging in your shop?
我想实现一个简单的调试日志,它包含一个表,我在其中插入有关事务当前状态的深刻信息。如何停止对我正在尝试调试的事务上的回滚影响的表的插入?在Oracle中,我可以使用PRAGMA AUTONOMOUS_TRANSACTION来确保插入是在事务之外完成的,但是我在T-SQL中有哪些选择?你如何在你的商店实施日志记录?
NB: I'm not using SQL Server, I'm using Sybase 12.5.
注意:我没有使用SQL Server,我使用的是Sybase 12.5。