user366312
user366312

Reputation: 16904

Non-system databases in SQL Server 2000

How to retrieve the names of all Nonsystem-databases from SQL Server 2000 using a TSQL query?

I have anticipated:

SELECT * 
FROM sysdatabases
where dbid >4
order by dbid

it does not seem to be reliable.

Anything else?

Upvotes: 3

Views: 1971

Answers (1)

Rodrigo
Rodrigo

Reputation: 4395

From SQL Server 2000 Books Online:

Each instance of SQL Server has four system databases (master, model, tempdb, and msdb) and one or more user databases.

So, master, model, msdb and temp are all the system databases. Your query can safely exclude just these.

Upvotes: 3

Related Questions