Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

A question about Constraints Expand / Collapse
Author
Message
Posted Monday, June 1, 2009 12:46 PM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Monday, February 6, 2012 12:43 PM
Points: 215, Visits: 640
Given the following 3 tables:

Sales Order - Primary Key SOID
Sales Order Detail - Primary Key SOID and Line #
Shipping Details - Primary Key SOID and Line #

I put a contraint on the Sales Order Detail to make sure the SOID is in the Sales Order Table.

I put a constraint on the Shipping Details to make sure that the SOID and the Line # exist in the Sales Order Detail.

Is it a good or a bad idea to add another constraint to the Shipping Details table to make sure that the SOID exists in the Sales Order Table? It seems redundant to me but I don't have enough experience to know if I am correct or not.

Thanks
Post #726909
Posted Monday, June 1, 2009 1:03 PM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Today @ 9:09 PM
Points: 20,739, Visits: 32,528
meichner (6/1/2009)

I put a constraint on the Shipping Details to make sure that the SOID and the Line # exist in the Sales Order Detail.

... It seems redundant to me ...

Thanks


I think you have answered your question right here.



Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Post #726920
Posted Monday, June 1, 2009 1:18 PM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Monday, February 6, 2012 12:43 PM
Points: 215, Visits: 640
Lynn Pettis (6/1/2009)
meichner (6/1/2009)

I put a constraint on the Shipping Details to make sure that the SOID and the Line # exist in the Sales Order Detail.

... It seems redundant to me ...

Thanks


I think you have answered your question right here.


Thanks for the fast response. As I said, I don't have enough experience to know if I was correct or not.

Thanks again
Post #726933
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse