SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Monitoring Changes in Your Database Using DDL Triggers


Monitoring Changes in Your Database Using DDL Triggers

Author
Message
Wayne West
Wayne West
SSCertifiable
SSCertifiable (5.9K reputation)SSCertifiable (5.9K reputation)SSCertifiable (5.9K reputation)SSCertifiable (5.9K reputation)SSCertifiable (5.9K reputation)SSCertifiable (5.9K reputation)SSCertifiable (5.9K reputation)SSCertifiable (5.9K reputation)

Group: General Forum Members
Points: 5920 Visits: 3702
Slightly slow afternoon, so I decided to go exploring. My gut feeling is that it won't work in 2005 or 2008, but I love working with system objects and really want to find a way to do it!

I wonder if running a log viewer tool might let you capture that info, or perhaps a trace somehow filtered to see only DDL statements.

BigGrin

-----
Knowledge is of two kinds. We know a subject ourselves or we know where we can find information upon it. --Samuel Johnson
Wayne West
Wayne West
SSCertifiable
SSCertifiable (5.9K reputation)SSCertifiable (5.9K reputation)SSCertifiable (5.9K reputation)SSCertifiable (5.9K reputation)SSCertifiable (5.9K reputation)SSCertifiable (5.9K reputation)SSCertifiable (5.9K reputation)SSCertifiable (5.9K reputation)

Group: General Forum Members
Points: 5920 Visits: 3702
Giovanny Gomez Convers (10/7/2008)
Hi!,
When I try delete a user on database, appears the next error message:

"SELECT failed because the following SET options have incorrect settings: 'ARITHABORT'. Verify that SET options are correct for use with indexed views and/or indexes on computed columns and/or query notifications and/or xml data type methods. (.Net SqlClient Data Provider)"

The Trigger is the reason for this message?

tks.

I have no problem adding or deleting a user to my DDL audited database. I'd suggest two things. First, check your audit table to make sure the data types are the same as in the article. You might want to change any char or varchar to nchar or nvarchar. Second, look up ARITHABORT in BOL, there are some database-specific configurations that can cause it to abort a transaction.

Good luck!

-----
Knowledge is of two kinds. We know a subject ourselves or we know where we can find information upon it. --Samuel Johnson
Wayne West
Wayne West
SSCertifiable
SSCertifiable (5.9K reputation)SSCertifiable (5.9K reputation)SSCertifiable (5.9K reputation)SSCertifiable (5.9K reputation)SSCertifiable (5.9K reputation)SSCertifiable (5.9K reputation)SSCertifiable (5.9K reputation)SSCertifiable (5.9K reputation)

Group: General Forum Members
Points: 5920 Visits: 3702
Carla Wilson (10/7/2008)
Wayne,
Wow, good job investigating system tables/views and triggers! (although I did not expect you to drop everything to do it - - I was just reply to your question.)
Your testing is much appreciated.

Finished the 2005 attempt: fail with the following message:

Msg 8197, Level 16, State 6, Procedure tr_syscolumns, Line 1
Object '_syscolumns' does not exist or is invalid for this operation.



Got the same error before trying to slide past it with view.

It seems to me that it should be possible. I glanced at this article here on SSC, so maybe it's possible, perhaps I just need to work at it a bit more.

BigGrin

-----
Knowledge is of two kinds. We know a subject ourselves or we know where we can find information upon it. --Samuel Johnson
sandhyarao49
sandhyarao49
SSC-Addicted
SSC-Addicted (461 reputation)SSC-Addicted (461 reputation)SSC-Addicted (461 reputation)SSC-Addicted (461 reputation)SSC-Addicted (461 reputation)SSC-Addicted (461 reputation)SSC-Addicted (461 reputation)SSC-Addicted (461 reputation)

Group: General Forum Members
Points: 461 Visits: 650
HI All,

As per the article I have created the AUDITLOG table and also created the trigger.

But when executed some DDl commands the AUDITLOG table is not working as expected.

CREATE TABLE dbo.test55(col INT)
GO
DROP TABLE dbo.test55
GO
-- View log table
SELECT *
FROM dbo.AuditLog

ID Command PostTime HostName LoginName
----------- ------------------------------ -------
1 NULL NULL ROOM-5E8A79FFB4 NULL
(1 row(s) affected)

My query is why the command column is not able to capture any event.Has something need to be done to capture the events.


Kindly assist me.




Thanks,
Sandhya
cliffb
cliffb
Ten Centuries
Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)

Group: General Forum Members
Points: 1333 Visits: 438
What is the declaration of your trigger?

By the NULLs, it appears that nothing is being pulled from EVENTDATA()



Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search