截断 SQL Server 日志文件的命令是什么?

2021-12-19 00:00:00 logging sql-server truncate

我需要在发送给同事之前清空 LDF 文件.如何强制 SQL Server 截断日志?

I need to empty an LDF file before sending to a colleague. How do I force SQL Server to truncate the log?

推荐答案

如果我没记错的话...在查询分析器或等效中:

if I remember well... in query analyzer or equivalent:

BACKUP LOG  databasename  WITH TRUNCATE_ONLY

DBCC SHRINKFILE (  databasename_Log, 1)

相关文章