SQL Server ??????????????
???????????? ???????[ 2015/10/23 14:51:21 ] ?????????????
????1.fn_listextendedproperty ?????????????????????????????????????????????ж???????????????磬?????????????????е?????????
????A.?????????????????????????????????????
????USE AdventureWorks2008R2;
????GO
????SELECT objtype?? objname?? name?? value
????FROM fn_listextendedproperty(default?? default?? default?? default?? default?? default?? default);
????GO
????B. ????????????е????????
?????????????????????? Production ????е? ScrapReason ???е??е?????????
????USE AdventureWorks2008R2;
????GO
????SELECT objtype?? objname?? name?? value
????FROM fn_listextendedproperty (NULL?? 'schema'?? 'Production'?? 'table'?? 'ScrapReason'?? 'column'?? default);
????GO
????C. ???????????б?????????
?????????????????????? Sales ????е????б??????????
????USE AdventureWorks2008R2;
????GO
????SELECT objtype?? objname?? name?? value
????FROM fn_listextendedproperty (NULL?? 'schema'?? 'Sales'?? 'table'?? default?? NULL?? NULL);
????GO
??????? sys.extended_properties ?????
?????????????? sys.extended_properties ??????????????????????????????????????????????????????????????????????????????????????????????磬????????????????????????????????
?????????????????????? sys.extended_properties ??????????????????????????????????????????????????????????????е????????
????A. ?????????е????????????
????????????????? AdventureWorks2008R2 ?????????е?????????????
????USE AdventureWorks2008R2;
????GO
????SELECT class?? class_desc?? major_id?? minor_id?? name?? value
????FROM sys.extended_properties;
????GO
????B. ???????????????????????????
????????????????? AdventureWorks2008R2 ????????????????????????????
????USE AdventureWorks2008R2;
????GO
????SELECT class?? class_desc?? major_id?? minor_id?? ep.name?? s.name AS [Index Name]?? value
????FROM sys.extended_properties AS ep
????INNER JOIN sys.indexes AS s ON ep.major_id = s.object_id AND ep.minor_id = s.index_id
????WHERE class = 7;
????GO
????C. ????????е????????
????????????????? AdventureWorks2008R2 ?????????????б??е??????е?????????
????USE AdventureWorks2008R2;
????GO
????SELECT major_id?? minor_id?? t.name AS [Table Name]?? c.name AS [Column Name]?? value AS [Extended Property]
????FROM sys.extended_properties AS ep
????INNER JOIN sys.tables AS t ON ep.major_id = t.object_id
????INNER JOIN sys.columns AS c ON ep.major_id = c.object_id AND ep.minor_id = c.column_id
????WHERE class = 1;
????GO
?????????????? sys.extended_properties ??????????????????????????????????????????????????????????????????????????????????????????????磬????????????????????????????????
?????????????????????? sys.extended_properties ??????????????????????????????????????????????????????????????е????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11