March 23, 2006 at 3:40 am
How to check the error logs for any errors using a query?
March 23, 2006 at 9:18 am
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:
WMI Tasks: Event Logs
Regards,Yelena Varsha
March 24, 2006 at 6:48 am
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.
March 24, 2006 at 8:03 am
I am getting the result as many rows but I only need rows showing errors.
March 28, 2006 at 9:03 am
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