Created
April 8, 2020 09:26
-
-
Save thomascsd/252d08d1c18f607184d026e237141588 to your computer and use it in GitHub Desktop.
SqlServer 清除Log的方式
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
找Log TableName | |
SELECT name, size/128.0 FileSizeInMB, | |
size/128.0 - CAST(FILEPROPERTY(name, 'SpaceUsed') AS int)/128.0 | |
AS EmptySpaceInMB | |
FROM sys.database_files; | |
清Log | |
DBCC SHRINKFILE (Database_Name_log , 1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment