Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 How do i tell the size of my db

Author  Topic 

mary_itohan
Posting Yak Master

191 Posts

Posted - 2008-09-21 : 04:42:33
How do i tell the size of my db in T-SQL ?

Thanks

_____________________


Yes O !

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-09-21 : 04:56:56
use sp_spaceused

http://msdn.microsoft.com/en-us/library/ms188776.aspx
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-09-21 : 10:11:24
sp_databases
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-09-21 : 13:21:11
quote:
Originally posted by sodeep

sp_databases


wont this lists all dbs and their sizes? Anyways to restrict this to show only current db and its size?
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-09-21 : 17:06:01
You are right Visakh!!

For specific database, we can also do like this:

sp_helpdb 'databasename'
Go to Top of Page

hey001us
Posting Yak Master

185 Posts

Posted - 2008-09-21 : 17:29:13
what about this?
SELECT * FROM sys.database_files

hey
Go to Top of Page
   

- Advertisement -