MS SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMS SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 9th, 2003, 07:56 PM
naph naph is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 50 naph User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 22 m 22 sec
Reputation Power: 7
How to query the database list

Hi! is there's a statement that will return the list of database in MS SQL? Thanks.

Reply With Quote
  #2  
Old December 11th, 2003, 01:22 AM
Scorpions4ever's Avatar
Scorpions4ever Scorpions4ever is offline
Banned ;)
Dev Shed God 7th Plane (8000 - 8499 posts)
 
Join Date: Nov 2001
Location: Glendale, Los Angeles County, California, USA
Posts: 8,100 Scorpions4ever User rank is General 16th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 16th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 16th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 16th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 16th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 16th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 16th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 16th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 16th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 16th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 16th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 16th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 16th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 16th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 16th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 16th Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 1 Day 8 h 50 m 41 sec
Reputation Power: 2059
select * from master..sysdatabases
__________________
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne

Puzzle of the Month solved by Keath and KevinADC, superior perl programmers of the month

Reply With Quote
  #3  
Old April 6th, 2009, 02:10 AM
shine.joseph shine.joseph is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2009
Posts: 2 shine.joseph User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 m 13 sec
Reputation Power: 0
list of database in MS SQL

Quote:
Originally Posted by naph
Hi! is there's a statement that will return the list of database in MS SQL? Thanks.


In SQL server 2005, you can use
SELECT * FROM SYS.DATABASES


IN SQL SERVER 2000, YOU HAVE TO QUERY THE SYSOBJECTS TABLE.

Reply With Quote
  #4  
Old April 6th, 2009, 03:57 AM
shammat shammat is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Oct 2003
Location: Munich, Bavaria
Posts: 1,365 shammat User rank is First Lieutenant (10000 - 20000 Reputation Level)shammat User rank is First Lieutenant (10000 - 20000 Reputation Level)shammat User rank is First Lieutenant (10000 - 20000 Reputation Level)shammat User rank is First Lieutenant (10000 - 20000 Reputation Level)shammat User rank is First Lieutenant (10000 - 20000 Reputation Level)shammat User rank is First Lieutenant (10000 - 20000 Reputation Level)shammat User rank is First Lieutenant (10000 - 20000 Reputation Level)shammat User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 2 Weeks 1 Day 12 h 46 m 43 sec
Reputation Power: 151
In all versions you should be able to simply use the stored procedure sp_databases

http://msdn.microsoft.com/en-us/library/aa259636(SQL.80).aspx

Reply With Quote
  #5  
Old April 6th, 2009, 07:15 AM
shine.joseph shine.joseph is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2009
Posts: 2 shine.joseph User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 m 13 sec
Reputation Power: 0
How to list all the tables in a database?..

Reply With Quote
  #6  
Old April 6th, 2009, 07:25 AM
shammat shammat is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Oct 2003
Location: Munich, Bavaria
Posts: 1,365 shammat User rank is First Lieutenant (10000 - 20000 Reputation Level)shammat User rank is First Lieutenant (10000 - 20000 Reputation Level)shammat User rank is First Lieutenant (10000 - 20000 Reputation Level)shammat User rank is First Lieutenant (10000 - 20000 Reputation Level)shammat User rank is First Lieutenant (10000 - 20000 Reputation Level)shammat User rank is First Lieutenant (10000 - 20000 Reputation Level)shammat User rank is First Lieutenant (10000 - 20000 Reputation Level)shammat User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 2 Weeks 1 Day 12 h 46 m 43 sec
Reputation Power: 151
Seems you are too lazy to have a look at the manual:

http://msdn.microsoft.com/en-us/library/aa259564(SQL.80).aspx

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMS SQL Development > How to query the database list


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT