Cannot validate, with novalidate option

前端 未结 2 1693
再見小時候
再見小時候 2020-12-20 02:39

Hi I was inserting some date do my table. For some reasons I had to disable my constraint. The constraint was associated with index. I. ve used this line of code:

         


        
2条回答
  •  长情又很酷
    2020-12-20 03:22

    When you inserted the rows into your table you violated the constraint, looks like it is a unique constraint based on the error message "duplicate keys found"

    check what columns the constraint is based on, and then do a quick query like the following to see if you have any rows with duplicates (columna and columnb are the columns in your unique constraint)

    SELECT columna, columnb COUNT() FROM mytable HAVING COUNT() > 1

    You won't be able to enable the unique constraint until all the rows in the table meet the rules of the constraint.

提交回复
热议问题