Apr 1, 2011

Find All The Database Name in SQL SERVER


Get all the available database in SQL Server, using following command.

Following all the command will list all the database on SQL Server.


--In SQL Server 2008

--This is the Stored Procedure which will retrieve database name and size in kb and remark

Exec sp_databases



This stored procedure will retrieve more column then previous sp and return size in mb rather than kb.
And owner of db, created date, and status of the database like status, updatability, useraccessibility etc.

Exec sp_helpdb



and finally below 2 sps will retrieve detailed information about the database mostly in technical terms.

 Technically terms in the sense dbid,status, file path etc.

Select * From sys.databases



Select * From sys.sysdatabases




5 comments:

Anonymous

thanks !

forum widget

Hey..It is incredible way of getting all database name in sql server. thanks a lot. It sounds to be very easy :-))

Cebu City Jobs

Thanks

Anonymous

I want all the databases whether it is attached or not to the server. How is it possible ???
The above query gives only the attached databases!!!

Anonymous

Every weekend i used to go to see this site, because i
want enjoyment, since this this web site conations really good funny information too.
Also visit my blog :: instant loan

Post a Comment

Author Profile

Total Pageviews

Categories

Followers

 
Top Programming   Sites Technology Top Blogs Technology blogs Technology Blogs

Sponsors