Re: DDL LOGON event - Audit Logins
- From: Erland Sommarskog <esquel@xxxxxxxxxxxxx>
- Date: Fri, 06 Jun 2008 15:50:55 -0700
Uday (Uday@xxxxxxxxxxxxxxxxxxxxxxxxx) writes:
So I added some code to check if the table (Tbl_AuditLogins) is existing
before trying to INSERT into that table.
But............Doesn't work....
So I added more code to see if the database (DBAdb) is existing before
attempting to INSERT.... if the database is not found or table in the
database is not found....just exit DDL-trigger without failure.
But...... Doesn't work
We don't see your code, so it's difficult to say why things do not
work as expected. But it may be safer to perform in the INSERT in
dynamic SQL which would be an inner scope that is not compiled until
you have verifed that database and table is inplace.
Options:
1: Make sure the table (Tbl_AuditLogins) or database (DBAdb) is not
DROPped --with a DDL trigger to rollback.
I don't think you can roll back DROP DATABASE... But you could disable
the login trigger in response to dropping the audit database.
--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.
- References:
- DDL LOGON event - Audit Logins
- From: Uday
- DDL LOGON event - Audit Logins
- Prev by Date: DDL LOGON event - Audit Logins
- Next by Date: Re: Turn off sharing to a database
- Previous by thread: DDL LOGON event - Audit Logins
- Index(es):
Relevant Pages
|