How can I prevent log growth in SQL Server when in

2020-04-30 18:11发布

问题:

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 can I prevent log file from growing?

回答1:

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.