Home > Archive > MS SQL Server > March 2006 > Help Pls - Reporting Table Descriptions Using sys.extended_properties









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Help Pls - Reporting Table Descriptions Using sys.extended_properties
Simon

2006-03-05, 8:24 pm

Hi, Using SQL Server 2005 I'm trying to write a view that joins two catalog
views (sys.tables and sys. extended_properties)
to produce a two column
result with the table name and it's description. Using the following T-SQL
excludes tables that do not have a description (ie that have
extended_properties but not the MS_Description field). Can anyone please
assist. Thanks.

SELECT TOP (100) PERCENT t.name, e.value
FROM sys.tables AS t LEFT OUTER JOIN
sys.extended_properties AS e ON t.object_id =
e.major_id
WHERE (e.name IS NULL OR
e.name = N'MS_Description') AND (e.minor_id IS NULL OR
e.minor_id = 0)
ORDER BY t.name


Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com