sp_estspace

Estimates the amount of space required for a table and its indexes, and the time needed to create the index.

Syntax

sp_estspace table_name, no_of_rows, fill_factor,
	cols_to_max, textbin_len, iosec, page_size

Parameters

Examples

Usage

To estimate the amount of space required by a table and its indexes:
  1. Create the table.

  2. Create all indexes on the table.

  3. Run sp_estspace, giving the table name, the estimated number of rows for the table, and the optional arguments, as needed.

For information about tables or columns, use sp_help tablename.

See also create index, create table in Reference Manual: Commands.

You do not need to insert data into the tables. sp_estspace uses information in the system tables—not the size of the data in the tables—to calculate the size of tables and indexes.

Permissions

Any user can execute sp_estspace. Permission checks do not differ based on the granular permissions settings.

Auditing

Values in event and extrainfo columns from the sysaudits table are:

InformationValues
Event

38

Audit option

exec_procedure

Command or access audited

Execution of a procedure

Information in extrainfo
  • Roles – Current active roles

  • Keywords or options – NULL

  • Previous value – NULL

  • Current value – NULL

  • Other information – All input parameters

  • Proxy information – Original login name, if set proxy in effect

Related reference
sp_dboption
sp_help