![]() ![]() Otherwise you will get the following error message: If the column has a constraint, you must drop the constraint prior to renaming the column. ![]() Make sure to check to see if any stored procedures are referencing the column prior to renaming it. This comes up as a reminder that the rename you just performed may have a negative effect on any stored procedures referencing the column. The syntax of sp_rename is the following:Įxec sp_rename ‘tablename.ColumnName’, ‘NewColumnName’, ‘column’ –objecttypeĮXEC sp_rename ‘Employees.FName’, ‘FirstName’, ‘column’Īfter executing the script above, you will receive the following informational message: In order to rename a column name, you must use sp_rename.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |