Re: Unique Constraint with Multiple NULLS
From: abombss <abombss_at_comcast.net>
Date: Thu, 1 Jan 2004 16:06:32 -0600
Message-ID: <QNidne__BrF6BGmiRVn-ig_at_comcast.com>
Date: Thu, 1 Jan 2004 16:06:32 -0600
Message-ID: <QNidne__BrF6BGmiRVn-ig_at_comcast.com>
"David Portas" <REMOVE_BEFORE_REPLYING_dportas_at_acm.org> wrote in message
news:G_2dncia7cWZCGmiRVn-uw_at_giganews.com...
>
> That depends on the feature-set of your particular RDBMS. What product are
> you using? You'll probably get more help if you post to a newsgroup for
that
> specific product. If you have full SQL-92 constraints then you can use a
> CHECK constraint instead:
>
> ..., CHECK (NOT EXISTS
> (SELECT colX
> FROM TableName
> GROUP BY colX
> HAVING COUNT(colX)>1))
>
Unfortunatly I am using MS-SQL Server which does not support subqueries in check constraints. I will need to stick with the trigger.
Thank you for the help,
Adam Received on Thu Jan 01 2004 - 23:06:32 CET