Hi all,
I have just started to try and implement DDL auditing triggers in SQL Server 2005 and get a Distributed Transaction error when inserting into a remote audit table. Part of the error reads:
'Cannot acquire a database lock during a transaction change. An error occurred during the changing of transaction context. This is usually caused by low memory in the system'
I have created a linked server between the two servers which works correctly and have assigned the correct permissions. There are no memory problems when the insert is attempted.
I have even tried a basic test trigger which also fails with the same error:
CREATE TRIGGER [tr_AuditTest]
ON ALL SERVER
FOR ALTER_AUTHORIZATION_SERVER,
CREATE_DATABASE,ALTER_DATABASE,DROP_DATABASE,
CREATE_ENDPOINT,DROP_ENDPOINT,
CREATE_LOGIN,ALTER_LOGIN,DROP_LOGIN,
GRANT_SERVER,DENY_SERVER,REVOKE_SERVER
AS
BEGIN
insert into [AUDITSERVER].[Audit].[dbo].test values(2)
END
The insert only fails when the trigger is fired. I am able to insert into the remote table using a T-SQL INSERT.
If anyone has successfully implemented auditing using DDL triggers and using a remote audit database, I would apreciate any help you can give.
Thanks,
Paul
I have just started to try and implement DDL auditing triggers in SQL Server 2005 and get a Distributed Transaction error when inserting into a remote audit table. Part of the error reads:
'Cannot acquire a database lock during a transaction change. An error occurred during the changing of transaction context. This is usually caused by low memory in the system'
I have created a linked server between the two servers which works correctly and have assigned the correct permissions. There are no memory problems when the insert is attempted.
I have even tried a basic test trigger which also fails with the same error:
CREATE TRIGGER [tr_AuditTest]
ON ALL SERVER
FOR ALTER_AUTHORIZATION_SERVER,
CREATE_DATABASE,ALTER_DATABASE,DROP_DATABASE,
CREATE_ENDPOINT,DROP_ENDPOINT,
CREATE_LOGIN,ALTER_LOGIN,DROP_LOGIN,
GRANT_SERVER,DENY_SERVER,REVOKE_SERVER
AS
BEGIN
insert into [AUDITSERVER].[Audit].[dbo].test values(2)
END
The insert only fails when the trigger is fired. I am able to insert into the remote table using a T-SQL INSERT.
If anyone has successfully implemented auditing using DDL triggers and using a remote audit database, I would apreciate any help you can give.
Thanks,
Paul