Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Retrieving list of current databases

Posted on 2004-04-21
3
Medium Priority
?
184 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 160 total points
ID: 10886072
use the following system stored procedure
exec sp_helpdb

regards,
venki
0
 
LVL 48

Accepted Solution

by:
AlexFM earned 240 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

971 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