truncate sql log

First off, You CANNOT REVERT this command, so be sure you want to truncate the log! THE QUERY Instructions: Just replace with your DB

BACKUP LOG WITH TRUNCATE_ONLY DBCC SHRINKDATABASE( ”, TRUNCATEONLY)

Howto: Fix an oversized modellog.ldf

modellog.ldf too big?

First try to figure out what’s using the log file:

use [model] select (sum(size) * (8192/1024)) / 1024 from dbo.sysfiles WHERE (status & 0×40) 0 DBCC SQLPERF(LOGSPACE) select ceiling((sum(size) * (8192.0/1024.0)) / 1024.0) from dbo.sysfiles exec sp_spaceused DBCC SQLPERF(LOGSPACE)

It is very unusual that the model database data or log files would . . . → Read More: Howto: Fix an oversized modellog.ldf