Answer the question
In order to leave comments, you need to log in
How to limit max value of int field in ms sql?
Good evening.
I came across a problem: it is necessary to store a set of int values in the database. They must all be between zero and 10. Can this be done at table creation time?
PS I know about triggers, I can control recording from .NET application. But installation of restriction during design \creation of the table interests.
Answer the question
In order to leave comments, you need to log in
create table numbers (
number int not null
check(number >= 1234 and number <= 4523),
...
)
create table numbers (
number int not null,
check(number >= 1234 and number <= 4523),
...
)
create table numbers (
number int not null,
constraint number_range_check
check(number >= 1234 and number <= 4523),
...
)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question