Syntax:
create table [Table_Name] (
[Column_Name] [dataType] constraint [Constraint_Name]
Default [Default_Value]
)
The Following example show how to add constraints during table creation process
create table MyTable(
id int not null constraint ConstID
Default 1,
name nvarchar(20)
)
The Following example show how to add constraints after the table has been created
alter table MyTable
add constraint MyConst
Default 'Default Value' for name
I hope it was informative for you and I would like to Thank you for reading
create table [Table_Name] (
[Column_Name] [dataType] constraint [Constraint_Name]
Default [Default_Value]
)
The Following example show how to add constraints during table creation process
create table MyTable(
id int not null constraint ConstID
Default 1,
name nvarchar(20)
)
The Following example show how to add constraints after the table has been created
alter table MyTable
add constraint MyConst
Default 'Default Value' for name
I hope it was informative for you and I would like to Thank you for reading