Can we use SQL to set a field of a table is not allow null and it's default.
For example, I have a St table and Seat field
I want to set the Seat field is not allow null, and it's default value to 1.
How can I wrte this SQL?
CREATE TABLE St (col1 int not null, Seat int not null default 1)
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"ad" <ad@.wfes.tcc.edu.tw> wrote in message news:OdXNMc9iFHA.3568@.tk2msftngp13.phx.gbl...
> Can we use SQL to set a field of a table is not allow null and it's default.
> For example, I have a St table and Seat field
> I want to set the Seat field is not allow null, and it's default value to 1.
> How can I wrte this SQL?
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment