Listing of tables using extended properties

  • How can I extract a list of tables from a database that have specific values in an extended property, e.g., I am thinking about creating an extended property for the type of table (i.e, lookup, summary, etc) and then I would like to be able to easily identify all of the tables that are of a certain type.

    TIA

    Dean

  • How abut this for a starting point:

    Dynamic TSQL for extended properties

    Select * from ::fn_listextendedproperty(NULL, 'user', 'dbo' ,'table', 'agents','column',Default)

    Hopes this helps 

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • This will list the table and extended property for any table with the word 'lookup' in the extended property.

    select o.name as Table_name,

     p.value as Extended_Property

    from sysobjects o

     inner join sysproperties p on o.id = p.id

    where p.smallid = 0

     and convert(varchar, p.value) like '%lookup%'

    order by o.name

    Hope this helps.

    Jarret

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply