472,102 Members | 2,117 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,102 software developers and data experts.

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 1440
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
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.