sql get a list of all databases code example Example: get database list in sql server SELECT name FROM master.dbo.sysdatabases