Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Databases in Server

Status
Not open for further replies.

inutelinside

Technical User
Apr 28, 2005
41
US
Hello Y'all,

How do you query all the database names in a particular server? Thanks.
 
--sql 2000
SELECT name FROM master..sysdatabases ORDER BY name

--sql 2005
SELECT name FROM master.sys.databases ORDER BY name
 
SQLDenis try running that one in sql2005

In earlier versions of SQL Server, the INFORMATION_SCHEMA.SCHEMATA view returned all databases in an instance of SQL Server. In SQL Server 2005, the view returns all schemas in a database. This behavior complies with the SQL Standard. For more information, see SCHEMATA (Transact-SQL).

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top