October 21, 2010 at 6:57 pm
I'm currently building a script to rename a number of my indexes but I'm running into problems with some of them. Occasionally it will spit out an error as follows:
Msg 15225, Level 11, State 1, Procedure sp_rename, Line 332
No item by the name of 'ix_name' could be found in the current database 'db', given that @itemtype was input as '(null)'.
The object is in the dbo schema so that's not the problem. What else might cause this to happen?
October 21, 2010 at 7:23 pm
Can you please post:
1. the line that is failing in your script.
2. the table and index CREATE statements when you script them out.
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
October 22, 2010 at 3:52 am
brian_winzeler (10/21/2010)
Msg 15225, Level 11, State 1, Procedure sp_rename, Line 332No item by the name of 'ix_name' could be found in the current database 'db', given that @itemtype was input as '(null)'.
See if you can find entry of your index in following query
USE yourdb
GO
select * from sys.indexes where name = 'ix_name'
-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done;-)
October 22, 2010 at 6:55 am
brian_winzeler (10/21/2010)
Msg 15225, Level 11, State 1, Procedure sp_rename, Line 332No item by the name of 'ix_name' could be found in the current database 'db', given that @itemtype was input as '(null)'.
Try this syntax:
sp_rename 'TableName.IndexName', 'NewIndexName'
October 22, 2010 at 10:28 am
That worked Suresh. Thanks! As usual it's something simple that escaped me :P.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply