In SQL Server, a single server can contain many databases. The following sections explain SQL Server stored procedures that return information about those databases.
The sp_databases stored procedure lists the databases available on a server. After connecting to the server, the program executes this SQL statement:
The following text shows the results of this statement on the book’s test server. The database named master contains information about the server, such as server user login information. Most of the other databases shown here are used by the examples in this book:
DATABASE_NAME DATABASE_SIZE REMARKS =============== ============= ======= Contacts 3072 NULL Customers 3072 NULL master ...