Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
raaj
Posting Yak Master
129 Posts |
Posted - 2008-12-14 : 23:41:49
|
| Hi Guys,I would like to know : How to write a query to list all the databases present on a particular server????Any suggestions????Thanks..... |
|
|
bklr
Master Smack Fu Yak Hacker
1693 Posts |
Posted - 2008-12-14 : 23:55:11
|
| select * from sys.databases |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-12-15 : 00:02:50
|
| if sql 2000 or earlier use select * from sysdatabases |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
raaj
Posting Yak Master
129 Posts |
Posted - 2008-12-15 : 00:21:58
|
| Hi guys,Thnx for your replies........Raaj... |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
onlyforme
Starting Member
25 Posts |
Posted - 2008-12-15 : 01:30:24
|
| select * from sys.tables where type='U'Thanks..... |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-12-15 : 01:34:38
|
quote: Originally posted by onlyforme select * from sys.tables where type='U'Thanks.....
Are you reading questions before posting? OP asked for listing database details.How do you think sys.tables provide database info? |
 |
|
|
JamesRyan
Starting Member
18 Posts |
Posted - 2008-12-15 : 09:49:51
|
| SQL 2005:SELECT * FROM sys.databasesJames Ryanwww.sqlhowto.co.uk |
 |
|
|
NeilG
Aged Yak Warrior
530 Posts |
Posted - 2008-12-15 : 10:40:22
|
| you can also try sp_helpdb |
 |
|
|
|
|
|