The wonders of views ...
Create a view called Partners and have it select only the partners from
Customer.
That way in your other sql you can reference the view and then not have to
make sure the critieria to only show partners is included.
Going further you may want to have you table called Person and have two
views - Customers and Partners - that select from the same table, but with
different criteria (and perhaps columns in the result set).
Make sure the SQL in the view is optimized (i.e. the columns refered to in
the where clause are properly indexed).
[quoted text, click to view] "Versteijn" <versteijn@538mail.nl> wrote in message
news:4d19834f.0307040410.54e3de39@posting.google.com...
> Hello
>
> I have a case where Partners are some kind of Super-Users and are
> stored in a SQL Server database. Best is IMO to put both in the same
> table:
>
> table Customers:
> CustomerID[pr.key]
> [blabla]
> PartnerID
>
> But of course I have to reference the partnerid from another table and
> I want SQL Server to maintain the integrity rules. I could split
> Customers en Partners into different tables, but that would not be
> wise i think.
>
> Or I could just reference the CustomerID from the other table and
> -know- that we are talking about a partner, but in that case it it
> possible to reference a customer that is not a partner, and i want to
> avoid that.
>
> Any ideas?
>
> Freek Versteijn