Re: DDL LOGON event - Audit Logins



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
.



Relevant Pages

  • Re: MS Access DAO -> ADO.NET Migration
    ... William Vaughn ... Microsoft MVP ... Hitchhiker's Guide to Visual Studio and SQL Server ... My migration app works building a SSCE database file with imported data ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Cluster will not fail over.
    ... > As far as the TCP/IP issue goes, you had to rebuild the cluster and were ... > able to restore the master database. ... > a cluster installation you'll have to revisit. ... >> This worked bringing up the sql server in minimal mode. ...
    (microsoft.public.sqlserver.clustering)
  • Re: MS Access DAO -> ADO.NET Migration
    ... full SQL Server and I see the logic you explained in a multi user ... allow two users to access the same database file Read/Write at any given ... The book was a pleasure to read after the gibberish that Microsoft 'puts ... Hitchhiker's Guide to Visual Studio and SQL Server ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: MS Access DAO -> ADO.NET Migration
    ... For that it is much harder to handle the incremental identifier, ... database but although they have the data, they are not connected at the same ... The book was a pleasure to read after the gibberish that Microsoft 'puts ... SQL Server Management Studio is nowhere to be found on my ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Word 2003/Access2000/SQLSVR
    ... SQL server being where the data is held and this is accessed through a MS ... entire database and that may be say a record for Berkshire. ... "Peter Jamieson" wrote: ... replaced with the first record on the table in use. ...
    (microsoft.public.word.mailmerge.fields)