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

CodeFunctionName What is this?

Public

Tested

Imported

Access is limited.

Login here using your Linkedin account. to see or download code.

No registration, not another password to remember, login using your Linkedin account and have access to all public codes in Bold.codes

Linkedin Login

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 4,155

Downloads 1,416

CodeID
DB ID