Unix Technical Forum

sp_Rename Problem...

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 ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > SQL Server

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-29-2008, 04:12 AM
Barry Young
 
Posts: n/a
Default sp_Rename Problem...

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




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-29-2008, 04:12 AM
serge
 
Posts: n/a
Default Re: sp_Rename Problem...

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?



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-29-2008, 04:12 AM
Barry Young
 
Posts: n/a
Default Re: sp_Rename Problem...

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?

>
>



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-29-2008, 04:13 AM
Erland Sommarskog
 
Posts: n/a
Default Re: sp_Rename Problem...

[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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:22 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com