This is a discussion on sp_Rename Problem... within the SQL Server forums, part of the Microsoft SQL Server category; --> SQL Server 7.0 I have a stored procedure that builds some tables. To minimize down time (it is the ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| SQL Server 7.0 I have a stored procedure that builds some tables. To minimize down time (it is the backend for a website), I build the tables into temp (not #temp) tables, drop and rename the tables with SP_Rename. On ONLY one of the table renames (1 of 8), I get the following Error: sp_rename error: 15248 Severity 11 Error: The parameter @oldname is either ambiguous or the claimed @itemtype ((null)) was wrong. It refers to Line 256. Again I get no errors doing the exact same process on the other 7 tables. Anybody have any ideas? Barry |
| |||
| If you try renaming the table manually in SQL EM, are you successful? Also, if you are successful, how about running your stored procedure now with the table's new name and see if it will fail again or not? What is the tablename by the way? > I have a stored procedure that builds some tables. To minimize down time > (it is the backend for a website), I build the tables into temp (not #temp) > tables, drop and rename the tables with SP_Rename. On ONLY one of the table > renames (1 of 8), I get the following Error: > > sp_rename error: 15248 Severity 11 > > Error: The parameter @oldname is either ambiguous or the claimed @itemtype > ((null)) was wrong. It refers to Line 256. > > Again I get no errors doing the exact same process on the other 7 tables. > > Anybody have any ideas? |
| |||
| Hi Serge, I can rename the table in Enterprise Manager just fine. The table name is Program. I have two tables when I start, Program and Program_BU. I either create a new table called Program_TMP or purge the table if it exists and do a bulk insert into it. This works fine. First I drop table Program_BU. Then I just rename Program to Program_BU which works fine. Then I want to rename Program_TMP to Program, and that is where I am getting the error. sp_rename error: 15248 Severity 11 Error: The parameter @oldname is either ambiguous or the claimed @itemtype ((null)) was wrong. It refers to Line 256. I use this process in the same stored procedure for the other 7 tables and it works fine. Again, I can rename the table in EM with no problem. Thanks! Barry I have two tables when I start "serge" <sergea@nospam.ehmail.com> wrote in message news:s9Q%c.25117$lP4.1531047@news20.bellglobal.com ... > If you try renaming the table manually in SQL EM, are you successful? > > Also, if you are successful, how about running your stored procedure now > with the table's new name and see if it will fail again or not? > > What is the tablename by the way? > > > > > I have a stored procedure that builds some tables. To minimize down time > > (it is the backend for a website), I build the tables into temp (not > #temp) > > tables, drop and rename the tables with SP_Rename. On ONLY one of the > table > > renames (1 of 8), I get the following Error: > > > > sp_rename error: 15248 Severity 11 > > > > Error: The parameter @oldname is either ambiguous or the claimed @itemtype > > ((null)) was wrong. It refers to Line 256. > > > > Again I get no errors doing the exact same process on the other 7 tables. > > > > Anybody have any ideas? > > |
| ||||
| [posted and mailed, please reply in news] Barry Young (youngbar@insightbb.com) writes: > I have a stored procedure that builds some tables. To minimize down > time (it is the backend for a website), I build the tables into temp > (not #temp) tables, drop and rename the tables with SP_Rename. On ONLY > one of the table renames (1 of 8), I get the following Error: > > sp_rename error: 15248 Severity 11 > > Error: The parameter @oldname is either ambiguous or the claimed @itemtype > ((null)) was wrong. It refers to Line 256. > Presumably you have a user-defined type with the same name as the table. sp_rename has a third argument which permits you to specify the type of object you want to rename. I believe the word to give is 'Table', but you may prefer to look it up in Books Online. -- Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se Books Online for SQL Server SP3 at http://www.microsoft.com/sql/techinf...2000/books.asp |