Select Extended Property from SQL Server tables

后端 未结 2 1831
栀梦
栀梦 2021-01-19 15:01

I am writing a simple CMS for a client\'s database. There are 12 tables and they need to manage all of the data in 4 of them.

I set up a dynamic data project (Linq-

2条回答
  •  野的像风
    2021-01-19 15:13

    Well, according to http://msdn.microsoft.com/en-us/library/ms177541.aspx, "major_id" for your class of extended properties (OBJECT_OR_COLUMN) really indicates the "object_id". So the following query would get you all the extended properties along with the tables they belong to:

    select p.*, t.*
    from sys.extended_properties p
    inner join sys.tables t on p.major_id = t.object_id
    where class = 1
    

    You can filter it as you like, but let me know if you need help.

提交回复
热议问题