Skip to content

Instantly share code, notes, and snippets.

@lotsahelp
Forked from mivano/create log table
Last active August 29, 2015 14:00
Show Gist options
  • Save lotsahelp/edf9e7ecb171614e36c6 to your computer and use it in GitHub Desktop.
Save lotsahelp/edf9e7ecb171614e36c6 to your computer and use it in GitHub Desktop.
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Logs]
(
[Id] [int] IDENTITY(1, 1) NOT NULL ,
[Message] [nvarchar](MAX) NULL ,
[MessageTemplate] [nvarchar](MAX) NULL ,
[Level] [nvarchar](128) NULL ,
[TimeStamp] [datetime2] NOT NULL CONSTRAINT [DF_Logs_TimeStamp] DEFAULT SYSDATETIME() ,
[Exception] [nvarchar](MAX) NULL ,
[Properties] [xml] NULL ,
CONSTRAINT [PK_Logs] PRIMARY KEY CLUSTERED ( [Id] ASC )
WITH ( PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON ) ON [PRIMARY]
)
ON [PRIMARY]
GO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment