Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 2005
»
SQL Server Newbies
»
A question about Constraints
A question about Constraints
Rate Topic
Display Mode
Topic Options
Author
Message
meichner
meichner
Posted Monday, June 01, 2009 12:46 PM
SSC Veteran
Group: General Forum Members
Last Login: Monday, February 06, 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
Lynn Pettis
Lynn Pettis
Posted Monday, June 01, 2009 1:03 PM
SSC-Insane
Group: General Forum Members
Last Login: Yesterday @ 9:17 PM
Points: 21,832,
Visits: 27,855
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
meichner
meichner
Posted Monday, June 01, 2009 1:18 PM
SSC Veteran
Group: General Forum Members
Last Login: Monday, February 06, 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 »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.