sql drop default 1

sql drop default

ALTER TABLE [TheTable] DROP CONSTRAINT [TheDefaultConstraint]

Here is what the above code is Doing:
1. It’s creating a new column called [TheNewColumn]
2. It’s copying the data from [TheColumn] to [TheNewColumn]
3. It’s dropping the default constraint on [TheColumn]
4. It’s dropping [TheColumn]
5. It’s renaming [TheNewColumn] to [TheColumn]
6. It’s adding the default constraint back to [TheColumn]

Similar Posts