Understanding the Metadata Function DATABASEPROPERTYEX()


SQL Server offers various metadata functions to return metadata information about databases and its objects. Today, I will discuss one of the popular system functions using which we can fetch database properties for a specified database. This article will explain the metadata function, DATABASEPROPERTYEX(), and its use cases.

The syntax to use this function is given in the below statement. You must specify the name of the database as the database argument and the name of the property from the below list as the property argument to return its result.

SELECT DATABASEPROPERTYEX ( database , property )

The list