Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Add a default value in SQL server compact?

I need to add default value column in SqlServer Compact....i am new to this SQL server compact so Plz anyone tell me the Solution of this....

Thanks In Advance

like image 269
Suryakavitha Avatar asked Oct 21 '25 16:10

Suryakavitha


1 Answers

You use the DEFAULT constraint when declaring the column.

See this MSDN article.

myCol INT NOT NULL DEFAULT (20)

In the example above, the values for column myCol will default to 20.

like image 173
Oded Avatar answered Oct 23 '25 06:10

Oded



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!