/* Important SQL Server error log entries, summed per collection and error (corruption, slow I/O, severe errors, login failures, stack dumps, AG). Sample is a message and can name logins and addresses: local only. Kept EventDays. */ CREATE TABLE insight.ErrorLogEvents ( EventId bigint IDENTITY(1, 1) NOT NULL CONSTRAINT PK_ErrorLogEvents PRIMARY KEY NONCLUSTERED, InstanceId int NOT NULL, CollectedAt datetime2(0) NOT NULL, Category varchar(32) NOT NULL, Error int NULL, Severity int NULL, [Count] int NOT NULL, FirstAt datetime2(0) NOT NULL, LastAt datetime2(0) NOT NULL, Sample nvarchar(500) NULL, Source varchar(16) NOT NULL ); CREATE CLUSTERED INDEX CX_ErrorLogEvents ON insight.ErrorLogEvents (InstanceId, LastAt);