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
 Database Design and Application Architecture
 using weak entity as foreign key to other table

Author  Topic 

chody23
Starting Member

1 Post

Posted - 2009-03-26 : 07:50:38
hii,
what syntax should i use, if i need to reference a strong entity + it's weak entity as a combined primary key in other table.
when i tried to combine them in the new table as an usuall two foreign keys, i recieved an error saying: "references invalid".
hope you can help me..

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-03-26 : 13:30:19
I don't know what you mean by strong entities and weak entities. Could you show us a data example? Plus show us the code you tried to run to create the two FKs.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

dportas
Yak Posting Veteran

53 Posts

Posted - 2009-03-28 : 12:47:29
You just need to reference the weak entity table. A foreign key can only reference one table and the weak entity by definition contains the key you need.

If you want more help then please post your CREATE TABLE statements for these tables.
Go to Top of Page
   

- Advertisement -