July 29, 2010 at 9:01 am
i m creating a script and for that i need database size..
i can use sp_helpdb but dbsize is in nvarchar and it has mb included in it...
is there any way to capture only the integer part of it..so that i can do calculations on it.
i was thinking of using substring but i think its not feasible.
July 29, 2010 at 11:38 am
Pulled from script originally written to run against 2000 but works in 2005
SELECT sum(convert(int,round((aa.size*1.000)/128.000,0)))
FROM dbo.sysfiles aa
LEFT JOIN dbo.sysfilegroups bb ON aa.groupid = bb.groupid
_____________________________________________________________________
- Nate
July 31, 2010 at 2:55 am
thnaks but i wanted the size of all databases present.by using ur script we first have to got to that database then run this script.
July 31, 2010 at 12:48 pm
These scripts should give you the information you are after.
Get Server Database File Information for all databases on a server
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=89058
Script to analyze table space usage within a database
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply