BUG: Cannot Rename an Index on a View (281326)



The information in this article applies to:

  • Microsoft SQL Server 2000 (all editions)

This article was previously published under Q281326
BUG #: 351346 (SHILOH)

SYMPTOMS

An index that is created on a view cannot be renamed. If you try to rename the index, this error message occurs:
Server: Msg 15248, Level 11, State 1, Procedure sp_rename, Line 192
Error: The parameter @oldname is either ambiguous or the claimed @itemtype (index) was wrong.

CAUSE

This functionality was not added to the sp_rename command.

WORKAROUND

Re-create the index.

STATUS

Microsoft has confirmed this to be a problem in SQL Server 2000.

MORE INFORMATION

Steps to Reproduce Problem

Create and run this code:
use pubs
go
create view TestView with schemabinding as select au_id, au_lname from dbo.authors
go
create unique clustered index ViewIndex on TestView (au_id)
go
exec sp_rename 'TestView.ViewIndex', 'NewViewIndex', 'index'
				


RESULT

This error message occurs:
Server: Msg 15248, Level 11, State 1, Procedure sp_rename, Line 192
Error: The parameter @oldname is either ambiguous or the claimed @itemtype (index) was wrong.



Modification Type:MajorLast Reviewed:10/16/2003
Keywords:kbBug kbpending KB281326