sp_spaceused:
Displays the number of rows, disk space reserved, and disk space used by a table, indexed view, or Service Broker queue in the current database, or displays the disk space reserved and used by the whole database.
Syntax:
sp_spaceused [[ @objname = ] 'objname' ] [,[ @updateusage = ] 'updateusage' ]
Arguments:
[ @objname=]
'objname'Is the name of the table, indexed view, or queue for
which space usage information is requested.
Permission to execute sp_spaceused is granted to the public role.
[ @updateusage=]
'updateusage'Indicates DBCC UPDATEUSAGE should be run to update
space usage information.
Only members of the db_owner fixed database role can specify
the @updateusage parameter.
Result Sets:
1) database_name
Name of the current database
2) database_size
3) unallocated
space
4) reserved
5) data
Total amount of space used by data. Size in Kilobytes
6) index_size
Total amount of space used by indexes. Size in Kilobytes
7) Unused
Displays the number of rows, disk space reserved, and disk space used by a table, indexed view, or Service Broker queue in the current database, or displays the disk space reserved and used by the whole database.
Syntax:
sp_spaceused [[ @objname = ] 'objname' ] [,[ @updateusage = ] 'updateusage' ]
Arguments:
[ @objname=]
'objname'Is the name of the table, indexed view, or queue for
which space usage information is requested.
Permission to execute sp_spaceused is granted to the public role.
[ @updateusage=]
'updateusage'Indicates DBCC UPDATEUSAGE should be run to update
space usage information.
Only members of the db_owner fixed database role can specify
the @updateusage parameter.
Result Sets:
1) database_name
Name of the current database
2) database_size
i) Size of the current database in megabytes.
ii) database_size includes both data and log files.
i) Space in the database that has not been reserved for database
objects.
Total amount of space allocated by objects in the database.
Size in Kilobytes
Total amount of space used by data. Size in Kilobytes
6) index_size
Total amount of space used by indexes. Size in Kilobytes
7) Unused
Total amount of space
reserved for objects in the database,but
not yet used. Size in Kilobytes
Comments
Post a Comment