What is the command to truncate a SQL Server log file?

后端 未结 7 1928
青春惊慌失措
青春惊慌失措 2020-12-07 06:57

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

7条回答
  •  余生分开走
    2020-12-07 07:39

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

    BACKUP LOG  databasename  WITH TRUNCATE_ONLY
    
    DBCC SHRINKFILE (  databasename_Log, 1)
    

提交回复
热议问题