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?
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
This works
EXEC sp_rename @objname = 'ENG_TEst."[ENG_Test_A/C_TYPE]"', @newname = 'ENG_Test_A/C_TYPE', @objtype = 'COLUMN'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With