Reputation: 3
I have a table with some computed columns. I want to be able to rename the columns which are referenced in these computed columns as well as rename the computed columns.
I have tried the following SQL commands:
Exec sp_rename 'tbl_1_PattFormulaTest6.SumOfNumbers123_calculation2', 'SumOfNumbers123_calculation2_edited', 'COLUMN'
I get this error message for trying to rename a referenced column:
Object cannot be renamed because the object participates in enforced dependencies.
So what's the proper way for renaming the columns referenced in the computed column and renaming the computed column itself?
Upvotes: 0
Views: 1530
Reputation: 33581
The way to do this is three steps.
Upvotes: 5