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