March 4, 2010 at 10:36 am
Does anyone know of a SQL stored procedure that queries the Windows Event Log?
I currently have a daily job that gathers SQL logs for all servers/instances (exec master.dbo.xp_readerrorlog). I would like to do the same for the Windows Event Log, that way I don't have to login to each server and review manually.
I have searched and found nothing so far.
March 4, 2010 at 12:06 pm
I do not know of an extended procedure that does this.
Do you want to perform this action for SQL Server of from a Windows Script?
http://msdn.microsoft.com/en-us/library/cc280386.aspx
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
March 4, 2010 at 12:12 pm
I want to execute it within an SSIS job.
March 9, 2010 at 2:40 pm
I used to use logparser from MS (you can search for its use on this forum) and this worked fine, but although you can build a query to limit what is returns, in my case records I already had based on date, is still took as long to return partial data as the whole log.
I have switched to using DumpEvt detailed in this article http://www.sql-server-performance.com/articles/per/event_logs_dumpevt_p2.aspx This keeps a tally on the last records collected and is a lot faster, you could run the N number of minutes to collect all the servers logs.
Andrew
March 9, 2010 at 2:42 pm
Thank you for the info. I will look into this.
September 25, 2020 at 6:20 pm
I know this is an old post, but figured I should add another approach that I found and will at least test out and may implement in production.
https://rcmtech.wordpress.com/2015/12/04/send-windows-event-logs-to-sql-database/
HTH
-- webrunner
-------------------
A SQL query walks into a bar and sees two tables. He walks up to them and asks, "Can I join you?"
Ref.: http://tkyte.blogspot.com/2009/02/sql-joke.html
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply