Showing posts with label unitofmeasure. Show all posts
Showing posts with label unitofmeasure. Show all posts

Sunday, March 11, 2012

Check Constraint isse

I have a UnitOf Measure Filed. I wish to constrain it to "KG", "LBS", or
empty.
If I add ' or UnitOfMeasure = null' to the check constraint all values are
accepted. Without it a value MUST be specified. How do I limit the
possibilities to "KG", "LBS", empty?
Remember, empty string and NULL are not the same thing...
CHECK UnitOfMeasure IN ('KG', 'LBS', '')
"bnhcomputing" <bnhcomputing@.discussions.microsoft.com> wrote in message
news:20151DE9-9B03-47AC-BCC4-E749A7D80497@.microsoft.com...
> I have a UnitOf Measure Filed. I wish to constrain it to "KG", "LBS", or
> empty.
> If I add ' or UnitOfMeasure = null' to the check constraint all values are
> accepted. Without it a value MUST be specified. How do I limit the
> possibilities to "KG", "LBS", empty?

Check Constraint isse

I have a UnitOf Measure Filed. I wish to constrain it to "KG", "LBS", or
empty.
If I add ' or UnitOfMeasure = null' to the check constraint all values are
accepted. Without it a value MUST be specified. How do I limit the
possibilities to "KG", "LBS", empty?Remember, empty string and NULL are not the same thing...
CHECK UnitOfMeasure IN ('KG', 'LBS', '')
"bnhcomputing" <bnhcomputing@.discussions.microsoft.com> wrote in message
news:20151DE9-9B03-47AC-BCC4-E749A7D80497@.microsoft.com...
> I have a UnitOf Measure Filed. I wish to constrain it to "KG", "LBS", or
> empty.
> If I add ' or UnitOfMeasure = null' to the check constraint all values are
> accepted. Without it a value MUST be specified. How do I limit the
> possibilities to "KG", "LBS", empty?