Skip to content

Latest commit

 

History

History
67 lines (50 loc) · 2.23 KB

File metadata and controls

67 lines (50 loc) · 2.23 KB
title sys.sp_flush_log (Transact-SQL) | Microsoft Docs
ms.custom
ms.date 03/14/2017
ms.prod sql-non-specified
ms.reviewer
ms.suite
ms.technology
database-engine
ms.tgt_pltfrm
ms.topic language-reference
f1_keywords
sp_flush_log_TSQL
sys.sp_flush_log
sys.sp_flush_log_TSQL
sp_flush_log
dev_langs
TSQL
helpviewer_keywords
sys.sp_flush_log
ms.assetid 75cc9f52-3b1f-4754-b1e7-ce0dd3323bc9
caps.latest.revision 6
author JennieHubbard
ms.author jhubbard
manager jhubbard

sys.sp_flush_log (Transact-SQL)

[!INCLUDEtsql-appliesto-ss2016-xxxx-xxxx-xxx_md]

Flushes to disk the transaction log of the current database, thereby hardening all previously committed delayed durable transactions.

If you choose to use delayed transaction durability because of the performance benefits, but you also want to have a guaranteed limit on the amount of data that is lost on server crash or failover, then execute sys.sp_flush_log on a regular schedule. For example, if you want to make sure you don’t lose more than x seconds worth of data, you would execute sp_flush_log every x seconds.

Applies to: [!INCLUDEssNoVersion] ([!INCLUDEssCurrent] through current version).

Executing sys.sp_flush_log guarantees that all previously committed delayed durable transactions are made durable. See the conceptual topic Control Transaction Durability for more information.

Topic link icon Transact-SQL Syntax Conventions

Syntax

  
sys.sp_flush_log  
  

Parameters

None.

Return Code Values

A return code of 1 indicates success. Any other value indicates failure.

Result Sets

None.

Sample code

.  
EXECUTE sys.sp_flush_log