all groups > sql server data warehouse > february 2005 >
You're in the

sql server data warehouse

group:

Two Foreign Keys on one column - problem


Re: Two Foreign Keys on one column - problem Adam Machanic
2/28/2005 12:31:47 PM
sql server data warehouse:
Unfortunately, you cannot define multiple cascading foreign keys; apparently
this can cause certain ambiguities when it comes time to cascade. One
possible solution is to enforce the cascade via INSTEAD OF triggers -- more
work, but I think it should be doable...


--
Adam Machanic
SQL Server MVP
http://www.sqljunkies.com/weblog/amachanic
--


[quoted text, click to view]

Two Foreign Keys on one column - problem Geni
2/28/2005 3:50:05 PM
Hi,
I have a problem.

My problem is :

I have two tables reprezentoing a tree, first table representing nades,
and second representing links

first - ID, Name second- ID1, ID2,weight
--------------------- ----------------------
| 1 | name 1 | | 2 | 1 | 6.0 |
| 2 | name 2 | | 2 | 5 | 7.3 |
| 3 | name 3 | | 3 | 5 | 8.99 |
| 5 | name 5 |

I try define foreign keys but I get a error on defining second foreign key:
ID -> ID1 , on update, on delete
ID -> ID2 , on update, on delete

How I can define desired foreign keys.

AddThis Social Bookmark Button