1.查询注释
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 = ‘ND_Certificates_M‘
2. 查询说明
select value,a.name FROM syscolumns a inner join sysobjects d on a.id=d.id and d.xtype=‘U‘ and d.name<>‘dtproperties‘ left join sys.extended_properties g on a.id=G.major_id and a.colid=g.minor_id where d.name = ‘CON_Review_M‘
3.新建注释
EXECUTE sp_addextendedproperty N‘MS_Description‘, N‘证照ID‘, N‘user‘, N‘dbo‘, N‘table‘, N‘ND_Certificates_M‘, N‘column‘, N‘lendingID‘
原文地址:https://www.cnblogs.com/tianxiaotian/p/10277261.html
时间: 2024-10-31 16:14:48