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

sqlserver添加查询表、字段注释

2024/3/16 16:38:19发布20次查看
欢迎进入windows社区论坛,与300万技术人员互动交流 >>进入 环境:xp sp3,sql server2008 1、sqlserver用语句给表注释 execute sp_addextendedproperty n'ms_description', n'表注释', n'user', n'dbo', n'table', n'表名', null, null 2、sqlserver用语句给
欢迎进入windows社区论坛,与300万技术人员互动交流 >>进入
环境:xp sp3,sql server2008
1、sqlserver用语句给表注释
execute sp_addextendedproperty n'ms_description', n'表注释', n'user', n'dbo', n'table', n'表名', null, null
2、sqlserver用语句给表的字段注释
execute sp_addextendedproperty n'ms_description', n'字段注释', n'user', n'dbo', n'table', n'表名', n'column', n'字段名'
3、查看sqlserver注释
select
a.name as table_name,
b.name as column_name,
c.value as column_description
from sys.tables a
inner join sys.columns b on b.object_id = a.object_id
left join sys.extended_properties c on c.major_id = b.object_id and c.minor_id = b.column_id
where a.name = '表名'
该用户其它信息

VIP推荐

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