Delete large amount of data in sql server

后端 未结 7 1510
误落风尘
误落风尘 2021-02-15 15:30

Suppose that I have a table with 10000000 record. What is difference between this two solution?

  1. delete data like :

    DELETE FROM MyTable
             
    
    
            
7条回答
  •  轮回少年
    2021-02-15 15:52

    The first will delete all the data from the table and will have better performance that your second who will delete only data from a specific key.

    Now if you have to delete all the data from the table and you don't rely on using rollback think of the use a truncate table

提交回复
热议问题