How to check the errorlogs for any errors?

  • How to check the error logs for any errors using a query?

  • Events from the SQL Server Logs are mostly in the Windows Event Log that you may query with the help of WMI query. See examples at:

    http://windowssdk.msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/wmi_tasks__event_logs.asp

    WMI Tasks: Event Logs

     

    Regards,Yelena Varsha

  • To read the current SQL error log, you could use xp_readerrorlog. Dump the ouptput into a temp table and examine it for keywords. The output of the xp is a littel different between 2000 and 2005 so you would need to modify your query or sp to match.

    MG

    "There are two ways of constructing a software design. One way is to make it so simple that there are obviously no deficiencies. And the other way is to make it so complicated that there are no obvious deficiencies."
    Tony Hoare

    "If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.

  • I am getting the result as many rows but  I only need rows showing errors.

  • Try this command from QA, with the correct path for your error log location, and look for the keywords you want such as warning , log full etc...

    EXEC sp_readerrorlog 1, "C:\Program Files\Microsoft SQL Server\MSSQL\LOG\ERRORLOG", 4, 'warning'

Viewing 5 posts - 1 through 4 (of 4 total)

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