Import error log

Imports the SQL Server error log into a table, so that it can be queried
This is a "Stored Procedure" that can be saved in SQL Server and called when needed
By: Narayana Vyas Kondreddi, http://vyaskn.tripod.com, vyaskn@hotmail.com
Limitation: With error messages spanning more than one line only the first line is included in the table


Public

Tested

My Own Work

To import the current error log to table myerrorlog
EXEC sp_import_errorlog 'myerrorlog'

To import the current error log to table myerrorlog, and overwrite the table 'myerrorlog' if it already exists
EXEC sp_import_errorlog 'myerrorlog', @overwrite = 1

To import the previous error log to table myerrorlog
EXEC sp_import_errorlog 'myerrorlog', 1

To import the second previous error log to table myerrorlog
EXEC sp_import_errorlog 'myerrorlog', 2

Views 3976
Downloads 1337