Query SQL Server error log from SQL

use master
go
declare @table table(logdate datetime,processinfo varchar(max),text varchar(max))
insert into @table exec xp_readerrorlog

select * from @table where processinfo like 'spid%' order by 1

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.