How can I prevent log growth in SQL Server when insert millions of records

后端 未结 1 1835
清歌不尽
清歌不尽 2021-01-28 18:49

I have an insert query that needs to insert 50 million records, but when I execute this query, my database log file grows to 100GB and stops because of disk full.

How ca

相关标签:
1条回答
  • 2021-01-28 19:20

    It seems that when useing "WITH (TABLOCK)" the query dont log. I solved it. Hope work for you. query would be like this : INSERT INTO TargetTable WITH (TABLOCK).

    and recover model must be simple.

    0 讨论(0)
提交回复
热议问题