ALTER INDEX (TSQL Statement)
changes the name of the index or primary key or unique constraint of the specified table.
Syntax
ALTER INDEX index_name ON <table_qname>
WITH NAME = new_index_name
<table_qname> ::= [ database_name. [ schema_name ] . | schema_name. ] table_name
Arguments
- index_name
- is the name of the index or
PRIMARY KEY
orUNIQUE
constraint. - <table_qname>
- is the qualified or unqualified name of the table.
- new_index_name
- is the new name of the index.
Remarks
Only sa or dbo is allowed to execute this statement.
This statement doesn’t exist in MS SQL Server (the stored procedure
sp_rename
is used instead).
Examples
ALTER INDEX idx_name ON clients WITH NAME = idx_client_name;