Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Case sensitive constraint

Author  Topic 

Torch
Starting Member

20 Posts

Posted - 2005-08-18 : 02:52:34
Im not sure on how a column in one of my tables can have a
case-sensitve constraint.

The column name is called "cooked" and I only want the values "NO" and "YES" (case-sensitive) to be entered into that column.

Any help in this matter would be much appreciated.

Torch.

Kristen
Test

22859 Posts

Posted - 2005-08-18 : 03:16:04
Would you be happy with "no" if it was automatically converted to upper case (e.g. in a Trigger)?

Then you could just have a constraint that checked for Yes/No

If you DO need case sensitive constraints then use a COLLATE with a Binary Collation in the comparison test.

Kristen
Go to Top of Page

JimL
SQL Slinging Yak Ranger

1537 Posts

Posted - 2005-08-18 : 11:03:40
The best way is to do this on the front end via a selector.

Jim
Users <> Logic
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2005-08-18 : 11:40:17
Jim,

I'm sat here visualising BCP and DTS as the "front end"

Kristen
Go to Top of Page
   

- Advertisement -