#PSTip Reading extended properties on database objects using SMO

Extended properties are an useful but, under utilized feature in SQL server. In an earlier tip, we saw that you can add extended properties to databases and other objects. You can also add them to columns in your tables, and many other objects in your databases.

Now for the fun part. Let us say we have a database ‘sqlchow’ in your instance. We can retrieve the extended properties, if they have been set, using the following code:

Like this:

About the author: Hemanth C Damecharla

Hemanth is a SQL*Server DBA and a PowerShell enthusiast who loves to keep looking for new things to tinker around with. He maintains that he can write poetry. He blogs at http://sqlchow.wordpress.com and you can follow him on Twitter: @sqlchow