表设计:
sql脚本:
USE [master]
GO
CREATE TABLE [dbo].[LogApplicationError](
[Id] [bigint] IDENTITY(1,1) NOT NULL,
[Url] [nvarchar](500) NULL,
[Address] [nvarchar](500) NULL,
[InnerException] [nvarchar](500) NULL,
[Method] [nvarchar](100) NULL,
[Source] [nvarchar](500) NULL,
[Exception] [nvarchar](4000) NULL,
[HappenedTime] [datetime2](7) NOT NULL,
[IsDeleted] [bit] NOT NULL,
[CreatedUserId] [varchar](50) NOT NULL,
[CreatedTime] [datetime2](7) NOT NULL,
[LastUpdatedTime] [datetime2](7) NOT NULL,
[LastUpdatedUserId] [varchar](50) NOT NULL,
CONSTRAINT [PK_LogApplicationError] 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
SET ANSI_PADDING OFF
GO
ALTER TABLE [dbo].[LogApplicationError] ADD CONSTRAINT [DF_LogApplicationError_HappenedTime] DEFAULT (getdate()) FOR [HappenedTime]
GO
ALTER TABLE [dbo].[LogApplicationError] ADD CONSTRAINT [DF_LogApplicationError_IsDeleted] DEFAULT ((0)) FOR [IsDeleted]
GO
ALTER TABLE [dbo].[LogApplicationError] ADD CONSTRAINT [DF_LogApplicationError_CreatedUserId] DEFAULT ('System') FOR [CreatedUserId]
GO
ALTER TABLE [dbo].[LogApplicationError] ADD CONSTRAINT [DF_LogApplicationError_CreatedTime] DEFAULT (getdate()) FOR [CreatedTime]
GO
ALTER TABLE [dbo].[LogApplicationError] ADD CONSTRAINT [DF_LogApplicationError_LastUpdatedTime] DEFAULT (getdate()) FOR [LastUpdatedTime]
GO
ALTER TABLE [dbo].[LogApplicationError] ADD CONSTRAINT [DF_LogApplicationError_LastUpdatedUserId] DEFAULT ('System') FOR [LastUpdatedUserId]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'标识列' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LogApplicationError', @level2type=N'COLUMN',@level2name=N'Id'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'异常Url' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LogApplicationError', @level2type=N'COLUMN',@level2name=N'Url'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'异常Address' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LogApplicationError', @level2type=N'COLUMN',@level2name=N'Address'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'异常实例' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LogApplicationError', @level2type=N'COLUMN',@level2name=N'InnerException'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'异常函数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LogApplicationError', @level2type=N'COLUMN',@level2name=N'Method'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'导致错误的应用程序或对象的名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LogApplicationError', @level2type=N'COLUMN',@level2name=N'Source'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'异常详情' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LogApplicationError', @level2type=N'COLUMN',@level2name=N'Exception'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'异常发生时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LogApplicationError', @level2type=N'COLUMN',@level2name=N'HappenedTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'逻辑删除' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LogApplicationError', @level2type=N'COLUMN',@level2name=N'IsDeleted'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建人(标识)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LogApplicationError', @level2type=N'COLUMN',@level2name=N'CreatedUserId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建时间(这条业务数据产生的时间)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LogApplicationError', @level2type=N'COLUMN',@level2name=N'CreatedTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'最后修改时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LogApplicationError', @level2type=N'COLUMN',@level2name=N'LastUpdatedTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'修最后改人(标识)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LogApplicationError', @level2type=N'COLUMN',@level2name=N'LastUpdatedUserId'
GO
EXEC sys.sp_addextendedproperty @name=N'Description', @value=N'全局错误日志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LogApplicationError'
GO
修改: 修最后改人(标识) -> 最后修改人(标识)