Click here to Skip to main content
15,915,324 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
don't match with existing primary key or unique constraint.

i created two tables one is emp and second table is income table

emp table emp_id how to give forigen key reference income table
Posted
Updated 16-May-12 23:46pm
v3

Hi ,
Both keys primary and foreign key have to be same data type .
Check this Article
http://www.functionx.com/sqlserver2000/Lesson11.htm[^]
http://msdn.microsoft.com/en-us/library/ms189049.aspx[^]
Best Regards
M.Mitwalli
 
Share this answer
 
Comments
VJ Reddy 22-May-12 23:10pm    
Good references. 5!
Mohamed Mitwalli 23-May-12 3:26am    
Thanks VJ :)
do you got any field common to both table?

for example

emp_id in both emp table and income table. Then you can use emp_id as foreign key.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900