|
Posted by Tom Moreau on 03/20/06 15:28
Doh! Coffee... I need coffee...
--
Tom
----------------------------------------------------
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinpub.com
..
"David Portas" <REMOVE_BEFORE_REPLYING_dportas@acm.org> wrote in message
news:1142860722.911871.308570@v46g2000cwv.googlegroups.com...
Tom Moreau wrote:
> Change it to:
>
> CHECK (R_ID1 = R_ID OR R_ID1 IS NULL),
>
> --
> Tom
>
> ----------------------------------------------------
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Columnist, SQL Server Professional
> Toronto, ON Canada
> www.pinpub.com
> .
Change it to:
CHECK (R_ID1 = R_ID)
The UNKNOWN case where R_ID1 is null will still be permitted.
Better still, get rid of R_ID1, which is apparently redundant - except
maybe if it is part of a foreign key. In the case of a foreign key I
would still look for a better design without the nullable column.
--
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--
[Back to original message]
|