sql中语句修改字段注释
--1、创建登录⽇志表
IF OBJECT_ID('oa_login_log')IS NOT NULL
DROP TABLE oa_login_log;
CREATE TABLE oa_login_log
(
id int PRIMARY KEY IDENTITY(1,1),
client_ip varchar(20),
original_loginname varchar(20),
loginname varchar(20),
data_status bit default(0),
gmt_create datetime default(getdate()),
gmt_modified datetime default(getdate()),
db_time_stamp timestamp
)
GO
--注释
EXEC sys.sp_addextendedproperty @name='MS_Description',@value='OA系统登录⽇志表',@level0type='SCHEMA',@level0name='dbo',@level1type='T ABLE',@level1name='oa_login_log';
EXEC sys.sp_addextendedproperty @name='MS_Description',@value='主键,编号',@level0type='SCHEMA',@level0name='dbo',@level1type='TABLE', @level1name='oa_login_log',@level2type='COLUMN',
@level2name='id';
增加字段的sql语句EXEC sys.sp_addextendedproperty @name='MS_Description',@value='客户端请求IP',@level0type='SCHEMA',@level0name='dbo',@level1type='TABLE' ,@level1name='oa_login_log',@level2type='COLUMN',
@level2name='client_ip';
EXEC sys.sp_addextendedproperty @name='MS_Description',@value='原登录⽤户名',@level0type='SCHEMA',@level0name='dbo',@level1type='TABLE' ,@level1name='oa_login_log',@level2type='COLUMN',
@level2name='original_loginname';
EXEC sys.sp_addextendedproperty @name='MS_Description',@value='切换登录⽤户名',@level0type='SCHEMA',@level0name='dbo',@level1type='TAB LE',@level1name='oa_login_log',@level2type='COLUMN',
@level2name='loginname';
EXEC sys.sp_addextendedproperty @name='MS_Description',@value='数据状态',@level0type='SCHEMA',@level0name='dbo',@level1type='TABLE',@le vel1name='oa_login_log',
@level2type='COLUMN',
@level2name='data_status';
EXEC sys.sp_addextendedproperty @name='MS_Description',@value='创建时间',@level0type='SCHEMA',@level0name='dbo',@level1type='TABLE',@le vel1name='oa_login_log',@level2type='COLUMN',
@level2name='gmt_create';
EXEC sys.sp_addextendedproperty @name='MS_Description',@value='时间戳',@level0type='SCHEMA',@level0name='dbo',@level1type='TABLE',@lev el1name='oa_login_log',@level2type='COLUMN',
@level2name='db_time_stamp';

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。