Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 one is to zero or many

Author  Topic 

P.Mahendarajah
Starting Member

3 Posts

Posted - 2013-09-19 : 06:49:47
Just wondering if there was a way to implement a one is to zero or many relationship with sql or can you only have a one is to one or many?

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2013-09-19 : 07:06:37
A normal foreign key is be default 1 to {0,1,infinity}.
You can enforce your rules by adding a trigger if necessary.



Microsoft SQL Server MVP, MCT, MCSE, MCSA, MCP, MCITP, MCTS, MCDBA
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-09-22 : 02:40:37
unless you make the column NOT NULL its always one to zero or many when you link column using foreign key relationship.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
   

- Advertisement -