Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Limiting entries into the column
Message
 
 
General information
Forum:
Microsoft SQL Server
Category:
Database design
Miscellaneous
Thread ID:
00759382
Message ID:
00759564
Views:
25
>>If my field can be either Y or N, how can I specify it? Or if the field can be only one of 3 predefined values?
>
>Do you want to limit the column to only containing one of those discrete values? If so, you'll want to add a CHECK constraint to the table:
>
>CREATE TABLE mytable (
> gender nchar(1) CHECK(gender IN ('m', 'f'))
>...
>)
>

Can I do it in designer? I already created tables...

I put it in designer, but it doesn't look, like it was created. E.g. in the script of table Creation I don't see it. Is it correct to do in table designer managing constraints?
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform