SQL stmt. for computing the size of a database
Posted in 2000
Topics: General Discussion
Hi, Is there a sql stmt. that will query the sysmaster database to get the size of a database ? I am interested in the sum of data pages + index pages. (i.e pages allocated but not free). I am sure this info. can be obtained from the onchek output but want to use that as a last resort. Thanks. -- Rajiv Jhaveri rajivp@qsun.mt.att.com
The following gives you the total allocated to a database : select sum(size) from sysextents where dbsname = '<dbname>' Rudy Rajiv P Jhaveri wrote: > Hi, > > Is there a sql stmt. that will query the sysmaster database to get > the size of a database ? > > I am interested in the sum of data pages + index pages. > (i.e pages allocated but not free). > > I am sure this info. can be obtained from the onchek output but > want to use that as a last resort. > > Thanks. > > -- > Rajiv Jhaveri > rajivp@qsun.mt.att.com >