469,323 Members | 1,460 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,323 developers. It's quick & easy.

Foreign Key on a table with no primary key

Hi,
Can we create a foreign key on a table where there is no primary key defined, although the referened table has primary key defined?

Thank You,
Mithu
Apr 15 '08 #1
5 1339
ck9663
2,878 Expert 2GB
Hi,
Can we create a foreign key on a table where there is no primary key defined, although the referened table has primary key defined?

Thank You,
Mithu

Did you try it?

-- CK
Apr 15 '08 #2
Did you try it?

-- CK

Hi,
Yes, I was trying to do it which intern giving me error. But I am not sure that that is because of this. I checked everything and seems that everything working good and are in place, so I may have doubt on this. Thats why I wanted to make it clear with you all.

Thank You,
Mithu
Apr 15 '08 #3
amitpatel66
2,367 Expert 2GB
Foreign key can be created on a table that has a primary key or unique key column
Apr 15 '08 #4
Hi,
Thanks for response.

But my question is just opposite to what you have answered. Can we create a foreign key on a table which dont have a primary key?
Apr 15 '08 #5
ck9663
2,878 Expert 2GB
What error are you getting? I just created one and it worked.

Here's the guide.


-- CK
Apr 15 '08 #6

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by Jeremiah Jacks | last post: by
2 posts views Thread by geoff | last post: by
9 posts views Thread by Jax | last post: by
5 posts views Thread by Bob Stearns | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
reply views Thread by listenups61195 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.