I am working on SQL server 2008 I want to get all the databases in the server with a specific property related to the database. Say for example we have an extended property with key "x" for some databases in the server. i want the result to be
DatabaseName | x
Db1 | value1
Db2 | value2
Db3 | value3
Db4 | null
where Db4 doesn't have the extended property with key "x"
any help Thank you very much
1条答案
按热度按时间h7appiyu1#
You can use
sys.extended_properties
(info) and dynamic SQL to get all extended properties.Output:
If you
print @sql
you will see query like this:After that you can use any filters on
#extprops
table.