Quantcast
Viewing latest article 34
Browse Latest Browse All 91

Answer by Christo for How to add a column with a default value to an existing table in SQL Server?

Alternatively, you can add a default without having to explicitly name the constraint:

ALTER TABLE [schema].[tablename] ADD  DEFAULT ((0)) FOR [columnname]

If you have an issue with existing default constraints when creating this constraint then they can be removed by:

alter table [schema].[tablename] drop constraint [constraintname]

Viewing latest article 34
Browse Latest Browse All 91

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>