Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Errors with sp_rename
Message
 
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Miscellaneous
Thread ID:
00851387
Message ID:
00852573
Views:
18
Hi Del,

This error cold be generated if script is run in wrong database.

>Hi all:
>
>The following script was generated by a third party product to rename some columns for me:
>
>
>EXECUTE sp_rename 'EXTRDETL.EXTRDETLID', 'pkEXTRDETL', 'COLUMN'
>go
>
>EXECUTE sp_rename 'EXTRDETL.EXTRMASTID', 'fkEXTRMAST', 'COLUMN'
>go
>
>EXECUTE sp_rename 'EXTRMAST.EXTRMASTID', 'pkEXTRMAST', 'COLUMN'
>go
>
>EXECUTE sp_rename 'EXTRSCRP.EXTRSCRPID', 'pkEXTRSCRP', 'COLUMN'
>go
>
>EXECUTE sp_rename 'EXTRSCRP.EXTRDETLID', 'fkEXTRDETL', 'COLUMN'
>go
>
>
>
>However, when this is executed (this also happens when executing from Query Analyzer), I get the following error:
>
>
>Server: Msg 15248, Level 11, State 1, Procedure sp_rename, Line 163
>Either the parameter @objname is ambiguous or the claimed @objtype (COLUMN) is wrong.
>Server: Msg 15248, Level 11, State 1, Procedure sp_rename, Line 163
>Either the parameter @objname is ambiguous or the claimed @objtype (COLUMN) is wrong.
>Server: Msg 15248, Level 11, State 1, Procedure sp_rename, Line 163
>Either the parameter @objname is ambiguous or the claimed @objtype (COLUMN) is wrong.
>Server: Msg 15248, Level 11, State 1, Procedure sp_rename, Line 163
>Either the parameter @objname is ambiguous or the claimed @objtype (COLUMN) is wrong.
>Server: Msg 15248, Level 11, State 1, Procedure sp_rename, Line 163
>Either the parameter @objname is ambiguous or the claimed @objtype (COLUMN) is wrong.
>
>
>I have reviewed BOL and I really don't see what the problem is with the script. I am logged in as SA and the appropriate database is selected when attempting this. 'COLUMN' is definitely an allowable option per BOL. Also, I've tried inserting a 'dbo.' in front of the table names and this does not resolve the apparent ambiguity either.
>
>Anyone have any futher ideas?
>
>Del
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform