How to check what databases are accessible?

Using the following SQL statement we can check what databases as accessible

SELECT name, HAS_DBACCESS(name) FROM sys.databases;
Spread the love