List All Attached Microsoft SQL Server Databases

August 25, 2005 | KB: 1011019
Server (MSDE) 6, Server (MSSQL) 6,Server (MSDE) 7, Server (MSSQL) 7

Summary

This article describes the method for determining what databases are currently attached to Microsoft SQL Server.

Note: This procedure applies to Microsoft SQL Server 2000 (MSSQL) and Microsoft SQL Server Desktop Edition (MSDE) installations. It does not apply to Oracle installations.

More Information

The following procedures provide a list of the databases that are currently attached to Microsoft SQL Server. Not all of the databases that are listed by this procedure are necessarily databases created for use with Laserfiche. Furthermore, a database may be attached to Microsoft SQL Server but not registered to the Laserfiche Server. These procedures will not in themselves indicate whether a particular database was created for use with Laserfiche, or whether it is registered to the Laserfiche Server.

If Enterprise Manager is available, it can be used to list the databases attached to your Microsoft SQL Server. If Enterprise Manager is not available, you can view a list of the attached databases using osql commands. Scripts that will automatically run these commands have been provided in the following instructions.

To list attached Microsoft SQL Server databases using Enterprise Manager

  1. Open Enterprise Manager.

    Note: The desired Microsoft SQL Server must be registered with Enterprise Manager. See the following MSDN article for information on registering a SQL Server:
    How to register a server (Enterprise Manager)

  2. Expand Microsoft SQL Servers.
  3. Expand SQL Server Group.
  4. Expand the SQL Server which you wish to check for attached databases.
  5. Select Databases.
  6. In the right-hand pane, you will see all attached databases.

    Note: If a database is attached or detached while this window is open, you may need to refresh in order to see a current list of attached databases. Press F5 to refresh.

To list attached Microsoft SQL Server databases using using a VBScript file containing osql commands

  1. Click here to download a vbscript file to attach a database.
  2. Double-click SqlDbList.vbs to run the script.
  3. In the first dialog box, type the name of your Microsoft SQL Server and click OK.
  4. A message will display a list of all attached databases.