Monday, September 9, 2024

How do I list all available databases on a SQL Server instance?

 You can list all databases on a SQL Server instance using:

SELECT name FROM sys.databases;

This returns the names of all databases on the server.