views:

60

answers:

2

Hi

how to display user databases in sqlserver

i queried as select sys.databases it displays all including msdb temp and all.

i need only user cretaed databases.

is there any query like : select * from sys.databases where type='u' ??

Help me.

Thanks in Advance

+2  A: 

Is there a reason it needs to be more advanced than just this?

SELECT * FROM sysdatabases WHERE name NOT IN('master', 'tempdb', 'model', 'msdb')
Robin Day
A: 

Or per this thread:

select * from sys.sysdatabases where dbid>4 and [name] not like '$'
fretje