使用sql创建表并添加注释
Create table T_ErrorLogTable_tb ( ELTID int identity(1,1) primary key,--编号 ELTTime date,--错误发生日期 ELTAddress nvarchar(50),--错误发生地址 ELTMessage nvarchar(200)--错误发生信息 )
--表注释 @value为注释内容 @leve12name为注释表名 EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'错误信息表' , @level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_ErrorLogTable_tb' --列注释 @value为注释内容 @leve12nane为注释列名 EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_ErrorLogTable_tb', @level2type=N'COLUMN',@level2name=N'ELTID'; EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'错误发生日期' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_ErrorLogTable_tb', @level2type=N'COLUMN',@level2name=N'ELTTime'; EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'错误发生地址' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_ErrorLogTable_tb', @level2type=N'COLUMN',@level2name=N'ELTAddress'; EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'错误发生信息' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_ErrorLogTable_tb', @level2type=N'COLUMN',@level2name=N'ELTMessage';