Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

sys.sp_xtp_checkpoint_force_garbage_collection (Transact-SQL)

Applies To: SQL Server 2014, SQL Server 2016 Preview

Topic Status: Some information in this topic is preview and subject to change in future releases. Preview information describes new features or changes to existing features in Microsoft SQL Server 2016 Community Technology Preview 2 (CTP2).

Marks source files used in the merge operation with the log sequence number (LSN) after which they are not needed and can be garbage collected. Also, it moves the files whose associated LSN is lower than the log truncation point to filestream garbage collection.

Topic link icon Transact-SQL Syntax Conventions

Applies to: SQL Server (SQL Server 2014 through current version).

sys.sp_xtp_checkpoint_force_garbage_collection [[ @dbname=database_name]


The database to run garbage collection on. The default is the current database.

0 for success. Nonzero for failure.

A returned row contains the following information:




Indicates the number of files that have been moved to filestream garbage collection. These are the files whose log sequence number (LSN) is less than the LSN of log truncation point


Indicates the number of data/delta files whose LSN has been updated with the log blockID of the end-of-log LSN.


Returns the last corresponding LSN up to which the files have been moved to filestream garbage collection.

Requires database owner permission.

exec [sys].[sp_xtp_checkpoint_force_garbage_collection] hkdb1

Community Additions

© 2015 Microsoft