Quantcast
Channel: How do you clear the SQL Server transaction log? - Stack Overflow
Viewing all articles
Browse latest Browse all 22

Answer by hey for How do you clear the SQL Server transaction log?

$
0
0

Some of the other answers did not work for me: It was not possible to create the checkpoint while the db was online, because the transaction log was full (how ironic). However, after setting the database to emergency mode, I was able to shrink the log file:

alter database <database_name> set emergency;use <database_name>;checkpoint;checkpoint;alter database <database_name> set online;dbcc shrinkfile(<database_name>_log, 200);

Viewing all articles
Browse latest Browse all 22

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>