Re: Using FKs to non PK unique-indexes

From: Brian Selzer <brian_at_selzer-software.com>
Date: Sat, 11 Feb 2006 20:25:21 -0500
Message-ID: <uadLyM3LGHA.2696_at_TK2MSFTNGP14.phx.gbl>


Good point. I stand corrected. In this situation integrity cannot be enforced declaratively with SQL Server without introducing redundancy.

<before.the.gods_at_gmail.com> wrote in message news:1139674864.573235.94660_at_g14g2000cwa.googlegroups.com...
> Hello Brian
>
> Consider the following data
>
> CLIENTS
> client1
> client2
>
> PRODUCTS
> product1
> product2
>
> CLIENTS_PRODUCTS
> clientproduct1 client1 product1
> clientproduct2 client2 product2
>
> ORDERS
> order1 client1
>
> ORDERS_PRODUCTS
> orderproduct1 order1 clientproduct2
>
>
> It is exactly the situation I want to avoid. In ORDERS_PRODUCTS, I got
> a pair of client/product that does not belong to the client that placed
> order1. The integrity plan you proposed failed to discard this
> situation
>
> BTG
>
Received on Sun Feb 12 2006 - 02:25:21 CET

Original text of this message