Explanation:
sys.databases contains information about all databases on the SQL Server instance.
• HAS_DBACCESS(name) = 1 filters out the databases you dont have access to.
•ORDER BY name sorts the result alphabetically.
Explanation:
sys.databases contains information about all databases on the SQL Server instance.
• HAS_DBACCESS(name) = 1 filters out the databases you dont have access to.
•ORDER BY name sorts the result alphabetically.
SELECT name FROM sys.databases WHERE HAS_DBACCESS(name) = 1 ORDER BY name;