By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,360 Members | 1,405 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,360 IT Pros & Developers. It's quick & easy.

Foreign Key on a table with no primary key

P: 6
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
Share this Question
Share on Google+
5 Replies


ck9663
Expert 2.5K+
P: 2,878
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

P: 6
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
Expert 100+
P: 2,367
Foreign key can be created on a table that has a primary key or unique key column
Apr 15 '08 #4

P: 6
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
Expert 2.5K+
P: 2,878
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.