17.06.2013 Views

Beginning Microsoft SQL Server 2008 ... - S3 Tech Training

Beginning Microsoft SQL Server 2008 ... - S3 Tech Training

Beginning Microsoft SQL Server 2008 ... - S3 Tech Training

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Appendix A: System Functions<br />

INDEX_COL<br />

The INDEX_COL function returns the indexed column name. The syntax is as follows:<br />

INDEX_COL(‘’, , )<br />

The table parameter specifies the name of the table, index_id specifies the ID of the index, and<br />

key_id specifies the ID of the key.<br />

INDEXKEY_PROPERTY<br />

This function returns information about the index key.<br />

INDEXKEY_PROPERTY(, , , )<br />

The table_id parameter is the numerical ID of data type int, which defines the table you wish to<br />

inspect. Use OBJECT_ID to find the numerical table_id. index_id specifies the ID of the index, and<br />

is also of data type int. key_id specifies the index column position of the key; for example, with a<br />

key of three columns, setting this value to 2 will determine that you are wishing to inspect the middle<br />

column. Finally, the property is the character string identifier of one of two properties you wish to<br />

find the setting of. The two possible values are ColumnId, which will return the physical column ID,<br />

and IsDescending, which returns the order that the column is sorted (1 is for descending and 0 is<br />

ascending).<br />

INDEXPROPERTY<br />

622<br />

The INDEXPROPERTY function returns the setting of a specified index property, given the table ID, index<br />

name, and property name. The syntax is as follows:<br />

INDEXPROPERTY(, , )<br />

The property parameter specifies the property of the index that is to be queried. The property parameter<br />

can be one of these possible values:<br />

❑ IndexDepth — The depth of the index.<br />

❑ IsAutoStatistic — The index was created by the autocreate statistics option of<br />

sp_dboption.<br />

❑ IsClustered — The index is clustered.<br />

❑ IsStatistics — The index was created by the CREATE STATISTICS statement or by the autocreate<br />

statistics option of sp_dboption.<br />

❑ IsUnique — The index is unique.<br />

❑ IndexFillFactor — The index specifies its own fill factor.<br />

❑ IsPadIndex — The index specifies space to leave open on each interior node.<br />

❑ IsFulltextKey — The index is the full-text key for a table.<br />

❑ IsHypothetical — The index is hypothetical and cannot be used directly as a data access path.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!