Why would you NOT set IGNORE_DUP_KEY to ON?

后端 未结 5 646

IGNORE_DUP_KEY = ON basically tells SQL Server to insert non-duplicate rows, but silently ignore any duplicates; the default behavior is to raise an error and a

5条回答
  •  忘掉有多难
    2021-01-04 22:28

    chances are the duplicates are in there by mistake anyway.

    I bet they are! They are bugs. You certainly want to know about them! Turing on IGNORE_DUP_KEY by default is...

    1. hiding bugs...
    2. ...by corrupting data. (Of course the database stays physically consistent, but the data is still wrong from a business logic standpoint.)

    This is a terrible choice by any standard.

    Turn it on under special circumstances and then get rid of it as fast as you can so you don't accidentally hide bugs.

提交回复
热议问题