July 12, 2016 at 12:21 pm
Hi Folks,
I tried to rename a column using 'sp_rename' procedure throwing the following error.
USE MyDB;
GO
EXEC sp_rename
@objname ='Schema_Name.Table_Name.Old_Column_Name',
@newname = 'New_Column_Name',
@objtype ='COLUMN';
GO
Msg 15248, Level 11, State 1, Procedure sp_rename, Line 240
Either the parameter @objname is ambiguous or the claimed @objtype (COLUMN) is wrong.
But if I use the SSMS designer to rename the column, it works fine.
Any one had this issue.
Thanks!
July 12, 2016 at 12:32 pm
I would like to recall this post. I was running under wrong database.
July 12, 2016 at 12:56 pm
SQL!$@w$0ME (7/12/2016)
I would like to recall this post. I was running under wrong database.
Don't worry about removing it;-)
😎
Suggest you look into colour coding the connections in SSMS and paying attention to which database you are connected to, adding SELECT DB_NAME()
at the start of the query might help
July 12, 2016 at 3:55 pm
Thanks!
July 12, 2016 at 11:51 pm
sp_RENAME 'dbo.AllocationDetails.[[Conversion_Fee]]]' , 'Conversion_Fee', 'COLUMN'
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply