How to implement a 'default' flag that can only be set on a single row
35
votes
16
answers
27315
views
For example, with a table similar to this:
create table foo(bar int identity, chk char(1) check (chk in('Y', 'N')));
It doesn't matter if the flag is implemented as a
char(1)
, a bit
or whatever. I just want to be able to enforce the constraint that it can only be set on a single row.
Asked by Jack Douglas
(40537 rep)
Aug 19, 2011, 12:41 PM
Last activity: Apr 30, 2022, 01:06 AM
Last activity: Apr 30, 2022, 01:06 AM