You're right...you should be able to create it.  Can you post the error that
SQL Server spits out when the table save fails due to whatever it's whining
about?

A shot in the dark....

Is the ID field in the color table set as the PK?  if not it won't let you
create the relationship.

Bryan Stevenson B.Comm.
VP & Director of E-Commerce Development
Electric Edge Systems Group Inc.
t. 250.920.8830
e. [EMAIL PROTECTED]

---------------------------------------------------------
Macromedia Associate Partner
www.macromedia.com
---------------------------------------------------------
Vancouver Island ColdFusion Users Group
Founder & Director
www.cfug-vancouverisland.com
----- Original Message -----
From: "Ian Skinner" <[EMAIL PROTECTED]>
To: "SQL" <[EMAIL PROTECTED]>
Sent: Wednesday, June 04, 2003 2:34 PM
Subject: Relational Design Question.


> I've got a DBA Relational Design question.  I've got two tables, one a
> category table, and the other a detail table where one field is a Foreign
> Key to the category table.  In my DBMS (SQL Server 2000), I am trying to
set
> up this relationship/constraint.  It is not allowing me to do this.  It
> gives me an error, because there are category records in the category
table
> that have not yet been used in the detail table.  Is this correct
behavior,
> or am I doing something wrong?  When creating a one to many relationship
> between tables, must you have matching keys for all records on both sides?
>
> A simple example
>
> Color Category Table
> ID Name
> 1 Red
> 2 Blue
> 3 Green
>
> Product Detail Table
> ID Name Color
> 1 Bike 1
> 2 Bike 2
> 3 Trike 1
> 4 Trike 2
> 5 Unicyc 1
>
> I am unable to create a relationship in this case, because there are no
> records in the Detail table that yet use the color Green.  This can't be
> correct?  If it is not correct, what may I be doing to cause the error.
>
>
> --------------
> Ian Skinner
> Web Programmer
> BloodSource
> Sacramento, CA
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=6
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=6

Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. 
http://www.fusionauthority.com/signup.cfm

                        

Reply via email to