Delete SQL Server 2005 records without logging

前端 未结 7 1128
北恋
北恋 2020-12-28 08:15

How to delete records from SQL Server 2005 tables without logging them into transaction logs.

I do not wish to log because once deleted, those records will never be

7条回答
  •  眼角桃花
    2020-12-28 08:53

    You are deleting stuff, but you have a where clause, so the usual performance recommendations about SQL apply.

    Have you used the SQL profiler to see the execution plan of the requests ? If you record these operations, you can use the performance wizard to analyze them and maybe suggest a new index.

    If you do a lot of individual delete statements (delete ... where id = xxx), you may be better off creating a temp table with all IDs and joining this temp table to have a single delete statement.

提交回复
热议问题