dbTalk Databases Forums  

add the drop database command in the SQL server log file

microsoft.public.sqlserver.server microsoft.public.sqlserver.server


Discuss add the drop database command in the SQL server log file in the microsoft.public.sqlserver.server forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Grille12
 
Posts: n/a

Default add the drop database command in the SQL server log file - 08-24-2011 , 08:07 AM






Hi,

I am trying to add to the default SQL server log file (in the section
/Management/SQL Server Logs from Management Studio) the command drop
database but in vain.
I used the command

exec sp_altermessage 13087 , with_log, true

to modify the existing message whose text value is drop but it does not
change anything when I drop a database.

Is this possible to add the command drop database in the existing default
logs?

thanks for your help

Reply With Quote
  #2  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: add the drop database command in the SQL server log file - 08-24-2011 , 04:51 PM






Grille12 (grille12 (AT) gmail (DOT) com) writes:
Quote:
I am trying to add to the default SQL server log file (in the section
/Management/SQL Server Logs from Management Studio) the command drop
database but in vain.
I used the command

exec sp_altermessage 13087 , with_log, true

to modify the existing message whose text value is drop but it does not
change anything when I drop a database.

Is this possible to add the command drop database in the existing default
logs?
I would say that was a most mysterious message. I don't know when/if
13087 is generated, but may it not be when a database is dropped.

You could set up a DDL-trgger on server level for DROP_DATABASE which
performs a RAISEEROR WITH LOG to have a message written to the error log.


--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.