How to add default value in SQL Server compact?

I need to add a default column to SqlServer Compact .... I am new to this SQL CD, so Plz will tell me the solution to this ....

Thanks in advance

+3
source share
2 answers

When declaring a column, a constraint is used DEFAULT.

See this MSDN article.

myCol INT NOT NULL DEFAULT (20)

In the above example, the values ​​for the column myColwill default to 20.

+4
source

https://technet.microsoft.com/en-us/library/ms174123(v=sql.110).aspx

ALTER TABLE [tblename] ALTER COLUMN [columnname] SET DEFAULT <defaultvalue>
0
source

Source: https://habr.com/ru/post/1741213/


All Articles