views:

23

answers:

1

Hi,

I'm trying to rename a column using sp_rename but it's referenced in a computed column. I'm getting the following error:

'Table.Column' cannot be renamed because the object participates in enforced dependencies.

As far as I can tell the (persisted) computed column is the only place this is referenced. I guess I can drop and recreate the computed column since I won't technically be losing any data, but I wondered if there was a cleaner way?

Thanks

Phil

+2  A: 

Given the SSMS runs into exactly the same error, I'm thinking there's not a better way than dropping and recreating the computed column.

Damien_The_Unbeliever
Which turns into a bit of a mess of dropping constraints and relationships and then reinstating them. Oh well.
Phil