Post Made Community Wiki by Jack Douglas
5 deleted 121 characters in body
source | link

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.

I am interested in solutions for any major RDMBS. Please post one answer per RDBMS and re-tag if it is not on the list.

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.

I am interested in solutions for any major RDMBS. Please post one answer per RDBMS and re-tag if it is not on the list.

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.

4 deleted 1 characters in body; edited title
source | link

How can Ito implement a 'default' flag that can only be set on a single row

forFor 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.

I am interested in solutions for any major RDMBS but please. Please post one answer per RDBMS and re-tag if it is not on the list.

How can I implement a 'default' flag that can only be set on a single row

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.

I am interested in solutions for any major RDMBS but please post one answer per RDBMS and re-tag if it is not on the list

How to implement a 'default' flag that can only be set on a single row

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.

I am interested in solutions for any major RDMBS. Please post one answer per RDBMS and re-tag if it is not on the list.

3 edited tags
| link
    Tweeted twitter.com/#!/StackDBAs/status/104574733915402240
2 edited tags
| link
1
source | link