Violation of Unique key constrant, cannot insert duplicate key,I got the above exception while inserting a record in table , I know this throws because of repeating same values again nd again. But in my case the column has no primary key , my table structure is as follows,
patient_id , int (primary-key)
address varchar (50),
city varchar (20),
cart_no varchar (20),
Male_Female varchar(20) .
Only patient_id has primary key and when new record inserted into table patient_id is
auto-generate but i want to insert new record of patient (example : patient_name- sachin) but this name is already have record in table then it gives violation exception but patient_name column does not have any key constraints so why this happens?
Give me a way, thanks!