How to avoid Duplicate values for INSERT in SQL?

前端 未结 6 635

I have one table named:

Delegates

This table has four fields:

ID(Auto increment, Primary)
MemberNo, FromYr, ToYr
         


        
6条回答
  •  轮回少年
    2020-11-27 08:16

    Just add a unique index on that column, then inserting duplicates will cause an error. You can then error handle it if it needs to fail gracefully

提交回复
热议问题