您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

MSSQL 添加字段说明

2024/2/18 19:12:55发布30次查看
mssql 字段添加方法。
--字段添加说明
exec sp_addextendedproperty 'ms_description', '要添加的说明', 'user', dbo, 'table', 表名, 'column', 列名
--删除字段说明
exec sp_dropextendedproperty 'ms_description', 'user', dbo, 'table', 表名, 'column', 字段名
--查看字段说明
代码如下:
select
[table name] = i_s.table_name,
[column name] = i_s.column_name,
[description] = s.value
from
information_schema.columns i_s
left outer join
sysproperties s
on
s.id = object_id(i_s.table_schema+'.'+i_s.table_name)
and s.smallid = i_s.ordinal_position
and s.name = 'ms_description'
where
objectproperty(object_id(i_s.table_schema+'.'+i_s.table_name), 'ismsshipped')=0
and i_s.table_name = 'jobs'
order by
i_s.table_name, i_s.ordinal_position
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product