I am trying to run the following:
EXEC sp_rename '"database_name"."table_name"."old_column_name"', 'new_column_name';
But I am getting an error:
Msg 15225, Level 11, State 1, Procedure sp_rename, Line 374
No item by the name of '"database_name"."table_name"."old_column_name"' could be found in the current database 'master', given that @itemtype was input as '(null)'.
It can't properly find the column you're trying to change.
USE database_name
GO
EXEC sp_rename 'table_name.old_column_name','new_column_name','COLUMN'
GO
It works without the COLUMN
object type, but added for security purposes.
Look at Microsoft's website for more info.
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