How do i change change/edit the constraint_name that is being displayed?
Asked
Active
Viewed 110 times
1 Answers
1
The constraint we need to rename is DF__oldername__c1__7C8480AE
. Now we need to drop the constraint and then add the new one as there's no way to simply alter the constraint in-place. We do that using:
ALTER TABLE Tablename DROP CONSTRAINT DF__oldername__c1__7C8480AE;
ALTER TABLE Tablename ADD CONSTRAINT DF__newname__c1
DEFAULT NEWSEQUENTIALID() FOR c1;
and we are done.

Super User
- 9,448
- 3
- 31
- 47

Shubhi Kala
- 26
- 1