Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / General / Data Warehousing / February 2005

Tip: Looking for answers? Try searching our database.

Two Foreign Keys on one column - problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Geni - 28 Feb 2005 13:50 GMT
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.

Thanks for read :}
Adam Machanic - 28 Feb 2005 17:31 GMT
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...

Signature

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

> Hi,
> I have a problem.
[quoted text clipped - 18 lines]
>
> Thanks for read :}
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.