Using sp_helpconstraint to find a table’s constraint information  Listing tables, columns, and datatypes

Chapter 8: Creating Databases and Tables

Finding out how much space a table uses

Use sp_spaceused to find out how much space a table uses:

sp_spaceused [objname] 

sp_spaceused computes and displays the number of rows and data pages used by a table or a clustered or nonclustered index.

To display a report on the space used by the titles table:

sp_spaceused titles
name    rows   reserved  data  index_size  unused      
------- -----  --------- ----- ---------   ------
titles  18     48 KB     6 KB  4 KB        38 KB
 
(0 rows affected)

If you do not include an object name, sp_spaceused displays a summary of space used by all database objects.





Copyright © 2005. Sybase Inc. All rights reserved. Listing tables, columns, and datatypes

View this book as PDF