microsoft:microsoft_sql_server:sql:shrink_vs_truncate
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
microsoft:microsoft_sql_server:sql:shrink_vs_truncate [2022/10/18 17:13] – peter | microsoft:microsoft_sql_server:sql:shrink_vs_truncate [2022/10/18 17:14] (current) – peter | ||
---|---|---|---|
Line 46: | Line 46: | ||
The **truncate** command changes the status of one or more virtual log files (VLF) from active to inactive, which marks those files for overwriting or reuse. | The **truncate** command changes the status of one or more virtual log files (VLF) from active to inactive, which marks those files for overwriting or reuse. | ||
- | | + | <WRAP info> |
+ | **NOTE:** The **truncate** command can also be substituted with **NO_LOG**, which will purge a database’s transaction log. | ||
* This may be interpreted as actual deletion. | * This may be interpreted as actual deletion. | ||
* It is notable that sql backup jobs will also automatically truncate log files. | * It is notable that sql backup jobs will also automatically truncate log files. | ||
* However, such process will not delete files unless **NO_LOG** is specified after the backup job. | * However, such process will not delete files unless **NO_LOG** is specified after the backup job. | ||
+ | |||
+ | </ | ||
Here is a sample T-SQL to perform this task manually: | Here is a sample T-SQL to perform this task manually: |
microsoft/microsoft_sql_server/sql/shrink_vs_truncate.1666113207.txt.gz · Last modified: 2022/10/18 17:13 by peter