Export (0) Print
Expand All
Expand Minimize

sys.sp_flush_log (Transact-SQL)

SQL Server 2014

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: SQL Server (SQL Server 2014 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

sys.sp_flush_log

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

.
EXECUTE sys.sp_flush_log

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft