Click here to Skip to main content
15,891,853 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello everyone,

I have Sql Server 2008 enterprise version installed on my machine. There are numbers of database listed including system generated database.

Now here is the issue ( I want to get user created database list only not system generated database.)

Please provide me query to get user created database list.

Thanks in advance
Posted

1 solution

In SQL 2005, you can try the following:
SELECT * FROM sys.databases where owner_sid != 1

SQL 2000
SQL
select * from sysdatabases

Please check the following link for other options:
http://databases.aspfaq.com/schema-tutorials/schema-how-do-i-list-the-databases-on-my-server.html[^]
 
Share this answer
 
Comments
awadhendra tiwari 18-Apr-11 10:04am    
This solution does give me correct answer. I need only user defined databases not system databases such as Master,Model or tempsDB.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900