Solved

Retrieving list of current databases

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Example works but why do I need to click twice on button 4 54
VS2010 Build fails to install 14 73
Problem to copy file 14 43
Web page design problem 3 11
Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

680 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