Solved

Retrieving list of current databases

Posted on 2004-04-21
3
172 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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ā€¦
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

757 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now