-- Get size of Database
EXEC DATABASENAME.dbo.sp_spaceused
-- Get size of a Table in database
EXEC DATABASENAME.dbo.sp_spaceused 'TABLENAME'
-- Get size of All tables in a database
EXEC DATABASENAME.dbo.sp_spaceused '?'
-- Sql Query
USE DATABASENAME
GO
DECLARE @database_size DECIMAL(15,2)
SELECT @database_size = SUM(((convert (dec (15,2),[size]) * 8192 / 1048576)))
FROM dbo.sysfiles
PRINT @database_size
Friday, April 3, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment