January 19, 2004 at 9:09 am
USE master
GO
CREATE TABLE dbo.tblLastErrors (
ErrorEntry varchar(255),
ErrorEntryID int
)
GO
CREATE PROCEDURE dbo.usp_Startup_ScanLastErrorlog
AS
SET NOCOUNT ON
TRUNCATE TABLE master.dbo.tblLastErrors
INSERT master.dbo.tblLastErrors EXEC master.dbo.xp_readerrorlog 1
GO
exec sp_procoption 'usp_Startup_ScanLastErrorlog', 'startup', 'true'
GO
Running this script and restarting should populate tblLastErrors with teh contents of the last SQL errorlog
This is a cut-down script from what I'm attempting.
The truncate works, not the INSERT.
Any ideas
Ta
Shawn
January 19, 2004 at 11:31 am
xp_readerrorlog is one of function of xpstar.dll which run after the startup procedure.
January 19, 2004 at 12:11 pm
I saw xpstar being loaded in the event log, but how does this affect the INSERT? Run it twice in the sp? Use WAITFOR?
January 19, 2004 at 12:14 pm
Yes. It looks like.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply