Sql – How to solve “Either the parameter @objname is ambiguous or the claimed @objtype (COLUMN) is wrong.”?

sqlsql server

If I try to execute below query:

EXEC sp_rename 'ENG_TEst.[ENG_Test_A/C_TYPE]', 'ENG_Test_AC_TYPE', 'COLUMN'

I get an error:

Either the parameter@objname is
ambiguous or the claimed @objtype
(COLUMN) is wrong.

How can I solve it?

Best Answer

Nuts. I hit this same error weeks ago, and after a lot of wasted time figured out how to make it work--but I've since forgotten it. (Not much help, other than to say yes, it can be done.)

Have you tried different combinations of brackets, or of with and without brackest? e.g.

EXEC sp_rename 'ENG_TEst.ENG_Test_A/C_TYPE', 'ENG_Test_AC_TYPE', 'COLUMN';
EXEC sp_rename '[ENG_TEst].[ENG_Test_A/C_TYPE]', 'ENG_Test_AC_TYPE', 'COLUMN';
EXEC sp_rename '[ENG_TEst].[ENG_Test_A/C_TYPE]', '[ENG_Test_AC_TYPE]', 'COLUMN';
EXEC sp_rename '[ENG_TEst].ENG_Test_A/C_TYPE', 'ENG_Test_AC_TYPE', 'COLUMN';

If all else fails, there's always

  • Create new table (as "xENG_TEst") with proper names
  • Copy data over from old table
  • Drop old table
  • Rename new table to final name
Related Topic