Little SQL Server Tricks: Rename Default Constraints
One would assume that renaming a default constraint should work the same way as renaming a primary key. For some unknown reason that was not the case as I had to fix the (dynamically generated) names of default constraints. The format that worked at last was this one:
1 |
exec sp_rename N'SCHEMA.NAME_OLD', N'NAME_NEW' , N'OBJECT'; |
Without the N in front of …