A list of SQL Server Databases

Hello
I have a DECommand that connects to SQL Server.
I would like to know how I can get a list of databases in that SQL Server at trhe run-time.
Thanks.
LVL 2
v_shalchianAsked:
Who is Participating?
 
SNilssonConnect With a Mentor Commented:

This Sql statement return all databas names on the server:


SELECT Name FROM master..sysdatabases
0
 
DMVCommented:
All right I ran the following:

   SELECT Name FROM master..sysdatabases

and received 8 database rows, one of which is blank.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.