We are using the following:
SELECT t.name AS TableName, ex.value AS Description FROM sys.tables AS t, sys.extended_properties AS ex WHERE ex.major_id = t.object_id AND ex.minor_id=0 AND ex.name = 'MS_Description'
However, it does not work of a database has 2 tables with different schemas but the same name. How can I get the Description for each schema.table in a database?
Also is this the best select to get the descriptions for version 9+? And is this the best for version 8- (when I think there was no concept of a schema???):
Select t.TABLE_NAME,ep.value FROM INFORMATION_SCHEMA.TABLES as t,dbo.sysproperties as ep WHERE ep.id = object_id(t.TABLE_NAME) AND t.TABLE_TYPE = 'BASE TABLE' AND ep.type=3 AND ep.name = 'MS_Description'
thanks - dave
Very funny video -
Reporting as a Metaphor
View Complete Post