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.
| Author |
Topic |
|
zubairmasoodi
Starting Member
35 Posts |
Posted - 2011-02-08 : 12:52:14
|
| HiI have a very simple Question and i know experts here will give me an instant reply.I have a table UserInfo withe the following columnsUserID P.KUserName PasswordCountryIDAnd an another Table Country with the following columnsCountryID P.KCountryNameWill it be advisable to add a foreign key constraint to User table On (CountryID) column which points to CountryID of Country tableIf Yes , why?If Not , Why not? and what is the alternate way, or there should be no relation between the two.All replies are deeply appreciatedThanksNew SQL Server Programmer |
|
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2011-02-08 : 13:35:50
|
| Yes.Any place you CAN have a foreign key you SHOULD have one.Why is easy. The most important thing is data integrity -- having good data. |
 |
|
|
|
|
|