Avatar of Shaun Wingrin
Shaun Wingrin
Flag for South Africa

asked on 

MySQL Unique Index & Prevention of Inserting Duplicate Records


Say, I have a table in MySQL 5.1 with certain indexes that are unique. When I do an insert query, I wish to prevent record duplication & hence the indexes. The stored procedure I have created needs to be run on occasion, more than once in order to fix up any errors.

When an insert query is executed for the second time, I get an error message that the data already exits. This is naturally expected. How can  I suppress this error message from displaying?

Microsoft SQL ServerMySQL ServerSQL

Avatar of undefined
Last Comment

8/22/2022 - Mon