Click here to Skip to main content
15,891,749 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have two table in first table there is two coloumn central_id_no, name, and in second table there is four coloumn central_id_no,name,address,central_id_no1 i am showing central_id_no on page from first table and i am inserting data in second table first table central_id_no is updating with second table central_id_no 1
but problem id duplicate no is occuring means two person assinging same central _id_no
it should not be i want unique central_id _no assign to indivisual person

What I have tried:

i have two table in first table there is two coloumn central_id_no, name, and in second table there is four coloumn central_id_no,name,address,central_id_no1 i am showing central_id_no on page from first table and i am inserting data in second table first table central_id_no is updating with second table central_id_no 1
but problem id duplicate no is occuring means two person assinging same central _id_no
it should not be i want unique central_id _no assign to indivisual person
Posted
Comments
[no name] 24-Jul-16 10:02am    
If your table2 having foreign key of column "central_id _no" from table1 you can add Unique constraint on it, so table2 will accept unique values from table1 only.

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