Drop Database x Sql Server Log

  • Hi, my question maybe be silly but why a statement like drop database doesn't log and a statement like start SqlAgent service does ?

    Thanks.

  • Log to where? SQL Server Log (ERRORLOG)?

    Remember that you also have the default trace. Something (including create/drop database) gets logged there.

    -- Gianluca Sartori

  • with trace ok but why doesn't log in ErrorLog ?

  • Not everything gets logged to ERRORLOG.

    Something gets logged to the default trace, something gets logged to the system health session, something is not logged at all unless captured by audits or other means.

    -- Gianluca Sartori

  • My question is why should it? It is captured by the default trace.

  • My question is why a start service like agent is logged and a drop database isn't ? Is there a sort of distinction between both statements ?

  • Lynn Pettis (4/24/2014)


    My question is why should it? It is captured by the default trace.

    Alexandre Araujo (4/24/2014)


    My question is why a start service like agent is logged and a drop database isn't ? Is there a sort of distinction between both statements ?

    I guess we could go on forever 🙂

    -- Gianluca Sartori

  • it's an issue of scope;

    the error log is targeted for things that affect the server itself; stops and starts, hardware errors,dropped connections, etc all appear there.

    From a SQL standpoint, dropping a database is not an error, just a DDL event.

    As a result,DDL events go into the default trace, or any other traces audits that are also watching for it, but ti's not an error, per se;

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Lowell (4/24/2014)


    As a result,DDL events go into the default trace, or any other traces audits that are also watching for it, but ti's not an error, per se;

    Thanks.

Viewing 9 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply