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

Forcing a row to be related to at least another row Expand / Collapse
Author
Message
Posted Thursday, June 6, 2013 3:50 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Thursday, July 10, 2014 9:50 AM
Points: 12, Visits: 85
Hallo
I need to implement this:
A row in table A must be in relationship with at least one row in table B.

Could this be achieved by constraints only?

Thanks in advance



Post #1460910
Posted Thursday, June 6, 2013 3:52 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 1:23 AM
Points: 6,158, Visits: 7,223
This sounds like a homework question. What you want is Foreign Keys and Relational Integrity. Use those as your keywords for google and you'll find what you're looking for.


- Craig Farrell

Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

For better assistance in answering your questions | Forum Netiquette
For index/tuning help, follow these directions. |Tally Tables

Twitter: @AnyWayDBA
Post #1460912
Posted Friday, June 7, 2013 12:42 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Thursday, July 10, 2014 9:50 AM
Points: 12, Visits: 85
Hallo Craig.
It's not so easy, thank you anyway.



Post #1460973
Posted Friday, June 7, 2013 12:53 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Wednesday, July 16, 2014 8:33 AM
Points: 2,616, Visits: 4,720
lordzoster (6/7/2013)
Hallo Craig.
It's not so easy, thank you anyway.


Why do you think it is not so easy? Applying referential integrity is not so difficult either.
Can you explain us the situation in a bit more detail?

We like to solve challenging questions.



Kingston Dhasian

How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
Post #1460977
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse