Read Error Log

  • Hi all,

    As I am aware that we can read errorlog through sp_readerrlog and xp_readerrorlog and both these read all the records in the errorlog. But I wanted to know how can we read the errorlog for the last 1 hour?

    can any one let me know how this can be done?

    Thanks,

    Ravi

  • Hi,

    Maybe you already figured it out, otherwise Google gave me this nice article: Reading the SQL Server log files using T-SQL

    Seems the key is to use xp_readerrorlog, the parameters are explainded in the article.

    Cheers

  • Hi,

    You can specify the FromTime and EndTime in the extended stored procedure.

    see the syntax below.

    xp_readerrorlog 1,1,search1, search2, fromtime, endtime, asc/desc

    Thanks,

Viewing 3 posts - 1 through 2 (of 2 total)

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