Solved

Retrieving list of current databases

Posted on 2004-04-21
3
177 Views
Last Modified: 2010-04-15
Does anyone have code to grab a list of database names on a SQL Server?
0
Comment
Question by:hobster
3 Comments
 
LVL 21

Assisted Solution

by:tovvenki
tovvenki earned 40 total points
ID: 10886072
use the following system stored procedure
exec sp_helpdb

regards,
venki
0
 
LVL 48

Accepted Solution

by:
AlexFM earned 60 total points
ID: 10886475
select * from master.dbo.SysDatabases

http://www.codeproject.com/cs/database/msde-gui.asp
0
 
LVL 23

Expert Comment

by:rama_krishna580
ID: 10886549
try this.....

The SQL Server specific way (all versions) is :-

select name from master..sysdatabases

The ANSI standard way (SQL 7 only) is :-

select CATALOG_NAME from INFORMATION_SCHEMA.SCHEMATA

Best of Luck

R.K


0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…

792 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question