kevaburg (12/6/2016)
Edit: Now I have read the post above you could change the Insert to read:
insert into tbl_errorlog EXEC sp_readerrorlog 0, 1, 'TempDB';
Good idea Thom!
If you're going to way, with a storage table, you'll need to do some kind of check that you haven't already inserted that row before inserting. You'll probably want a stanging/temporary table. The Logs create a new file at each restart, so it depends how often restart, but also remember to take these into account so that if you run between a restart, you can get the previous logs.
Thom~
Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
Larnu.uk