Re: About size of database



Gautam,

In addition to the space the database uses, to find the space each table
takes you can run:
sp_spaceused tablename

A query that closely approximates this answer for all tables is:

SELECT OBJECT_NAME(object_id),
SUM
(CASE
WHEN index_id < 2 THEN
used_page_count * 8 -- Each page is 8 KB
ELSE 0
END) AS DataSpaceKB,
SUM
(CASE
WHEN index_id >= 2 THEN
used_page_count * 8 -- Each page is 8 KB
ELSE 0
END) AS IndexSpaceKB
from sys.dm_db_partition_stats
GROUP BY OBJECT_NAME(object_id)
ORDER BY DataSpaceKB DESC

This is ordered to put the big tables at the top of the list, but you can
order as you wish.

RLF

"Gautam" <Gautam@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:AEFB60F5-30E4-49AC-87FD-E855E8DFF030@xxxxxxxxxxxxxxxx
Is there any query which is usefull for finding the size of a existing
database in sqlserevr2005 ? and how we find that the which object contain
how
much size of database ?



.



Relevant Pages

  • Re: DBMS and lisp, etc.
    ... Naively implemented with SQL, again for 10 ... (1 query for the initial orders, 1 query for each order for its ... soon as you upgrade to the SQL database. ... (eq (order-customer orderA) ...
    (comp.lang.lisp)
  • Re: OT: SQL
    ... query processing. ... FROM Employees e, Employees m, Management mgt ... Manager and Employee Salaries. ... The scheme used does not model database files in general, ...
    (sci.logic)
  • Re: access 2003
    ... I removed the parameters from the form query source. ... boxes from the form header, events, code, etc and ran the form query source ... forms queries and the SQL because syntax of the SQL will change randomly. ... the Access 97 database, I wouldn't have thought any expressions would be ...
    (microsoft.public.access.conversion)
  • RE: Import external data - web query
    ... Your reply for my query is very extensive, this is for importing a file from ... The data source I want isn't listed in the Select Data Source dialog box. ... information used to connect to a database. ... Check your driver First, make sure you have the right ODBC driver (Open ...
    (microsoft.public.excel.misc)
  • Re: access 2003
    ... I removed the parameters from the form query source. ... synchronize combo boxes to the detail section or the parameter form query ... forms queries and the SQL because syntax of the SQL will change randomly. ... the Access 97 database, I wouldn't have thought any expressions would ...
    (microsoft.public.access.conversion)