Rename a constraint in SQL Server?

前端 未结 5 626
迷失自我
迷失自我 2020-12-14 14:33

Is it possible to rename a constraint in SQL Server? I don\'t want to have to delete and create a new one because this constraint affects other already existing constraints

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-14 14:48

    After some more digging, I found that it actually has to be in this form:

    EXEC sp_rename N'schema.MyIOldConstraint', N'MyNewConstraint', N'OBJECT'
    

    Source

提交回复
热议问题