November 18, 2015 by admin SQL Server – How to get all database names in SQL Server One of my colleague ask me a query to retrieve all the database names in a SQL Server. Here is the SQL Server Query to retrieve the same. Query: SELECT name FROM master.dbo.sysdatabases Share this: