I need a SQL query to find the names of existing databases.
Another to add to the mix:
EXEC sp_databases