SQL - Dervied Foreign Key - Possible?

Posted by Chad on Stack Overflow See other posts from Stack Overflow or by Chad
Published on 2010-06-05T14:46:25Z Indexed on 2010/06/05 14:52 UTC
Read the original article Hit count: 165

I'm just curious if this is possible, specifically in SQL CE (Express) with support in .NET's Entity Framework:

Table1 (primary)
-nvarchar(2000) url
-...

Table2 (with foreign key)
-nvarchar(2000) domain
-...

foreign key on Table2.domain references Table1.url such that Table.url contains Table2.domain

e.g.

Table1:
http://www.google.com/blah/blah
http://www.cnn.com/blah/
http://www.google.com/foo

Table2:
google.com
cnn.com

Is it possible for this to be scripted and enforced by SQL CE (let alone any relation database) and, if so, can .NET's Entity Framework automatically support this if I import my database into a model?

© Stack Overflow or respective owner

Related posts about .NET

Related posts about sql