When AUTO_CLOSE is set to ON, some columns in the sys.databases catalog view and the DATABASEPROPERTYEX function will return NULL because the database is unavailable to retrieve the data. To resolve this issue, run a USE statement to open the database.