Minimally Logged Insert Into

后端 未结 2 1580
温柔的废话
温柔的废话 2021-01-18 06:53

I have an INSERT statement that is eating a hell of a lot of log space, so much so that the hard drive is actually filling up before the statement completes.

2条回答
  •  花落未央
    2021-01-18 07:28

    Upload the data into tempdb instead of your database, and do all the intermediate transformations in tempdb. Then copy only the final data into the destination database. Use batches to minimize individual transaction size. If you still have problems, look into deploying trace flag 610, see The Data Loading Performance Guide and Prerequisites for Minimal Logging in Bulk Import:

    Trace Flag 610

    SQL Server 2008 introduces trace flag 610, which controls minimally logged inserts into indexed tables.

提交回复
热议问题