在T-SQL中的事务期间实现日志记录的最佳方法是什么?

时间:2022-08-10 09:34:29

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。

1 个解决方案

#1


2  

Finally tracked down the Sybase manuals on line. According to the documents, it looks like your only way out is to log via RPC to an external log server.

最后在线查看了Sybase手册。根据文档,看起来你唯一的出路是通过RPC登录到外部日志服务器。

#1


2  

Finally tracked down the Sybase manuals on line. According to the documents, it looks like your only way out is to log via RPC to an external log server.

最后在线查看了Sybase手册。根据文档,看起来你唯一的出路是通过RPC登录到外部日志服务器。