Sql-Server

SQL Server 登錄觸發器導致分佈式事務協調器出現問題

  • July 26, 2011

我在我的 SQL Server 2005 上創建了以下簡單的登錄觸發器:

CREATE TRIGGER LOGON_RESTRICTION ON ALL SERVER
FOR LOGON
AS
BEGIN
 PRINT 'Hello World'
END
GO

在大多數情況下,這似乎工作正常,除非涉及 DTC。我收到的錯誤消息是:

The server failed to resume the transaction. Desc:4d00000273.

和:

Process ID 77 attempted to unlock a resource it does not own: DATABASE: 36 . Retry the transaction, because this error may be caused by a timing condition. If the problem persists, contact the database administrator.
An error occurred during the changing of transaction context. This is usually caused by low memory in the system. Try to free up more memory.

我遇到了這篇文章,它在某種程度上解釋了可能的原因,但最後的解決方案並不是我所追求的。

最終,我想使用觸發器來限制從某些 IP 地址對某些登錄的訪問。

如果您仔細閱讀文章評論中的討論,您會發現一個指向KB951188的連結,其中詳細說明了在 CU7 中修復的 SP2 中的錯誤。檢查您的版本級別以查看它是否適用。

引用自:https://dba.stackexchange.com/questions/3789