Tarik
Tarik

Reputation: 81721

Clear DB Log File in SQL Server

I am looking for a tsql or query which will clear the transaction log file/

Thanks in advance.

Upvotes: 1

Views: 647

Answers (2)

amit-agrawal
amit-agrawal

Reputation: 1603

' execute with admin priveleges

BACKUP LOG db_name WITH NO_LOG

GO

DBCC SHRINKDATABASE( db_name, 0)

GO

Upvotes: 0

KM.
KM.

Reputation: 103587

try:

DUMP TRANSACTION [database_name] WITH NO_LOG

Upvotes: 2

Related Questions