Skip to content

Commit cfbef20

Browse files
formating fixes
1 parent 28bb0da commit cfbef20

8 files changed

Lines changed: 30 additions & 21 deletions

docs/relational-databases/system-stored-procedures/change-tracking-stored-procedures-transact-sql.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,6 @@ ms.author: bspendolini
3838
## See Also
3939

4040
[About Change Tracking (Transact-SQL)](../../relational-databases/track-changes/about-change-tracking-sql-server.md)
41-
[Change Tracking Cleanup (Transact-SQL)](../../relational-databases/track-changes/cleanup-and-troubleshooting-change-tracking-sql-server.md)
41+
[Change Tracking Cleanup and Troubleshooting (Transact-SQL)](../../relational-databases/track-changes/cleanup-and-troubleshooting-change-tracking-sql-server.md)
4242
[Change Tracking Functions (Transact-SQL)](../../relational-databases/system-functions/change-tracking-functions-transact-sql.md)
4343
[Change Tracking System Tables (Transact-SQL)](../../relational-databases/system-tables/change-tracking-tables-transact-sql.md)

docs/relational-databases/system-stored-procedures/sys-sp-flush-commit-table-on-demand-transact-sql.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ This procedure must be run in a database that has change tracking enabled.
8282

8383
## See Also
8484

85-
[Change Tracking Stored Procedures (Transact-SQL)](../../relational-databases/system-stored-procedures/change-tracking-stored-procedures-transact-sql.md)
8685
[About Change Tracking (Transact-SQL)](../../relational-databases/track-changes/about-change-tracking-sql-server.md)
87-
[Change Tracking Cleanup (Transact-SQL)](../../relational-databases/track-changes/cleanup-and-troubleshooting-change-tracking-sql-server.md)
86+
[Change Tracking Cleanup and Troubleshooting (Transact-SQL)](../../relational-databases/track-changes/cleanup-and-troubleshooting-change-tracking-sql-server.md)
8887
[Change Tracking Functions (Transact-SQL)](../../relational-databases/system-functions/change-tracking-functions-transact-sql.md)
8988
[Change Tracking System Tables (Transact-SQL)](../../relational-databases/system-tables/change-tracking-tables-transact-sql.md)
89+
[Change Tracking Stored Procedures (Transact-SQL)](../../relational-databases/system-stored-procedures/change-tracking-stored-procedures-transact-sql.md)

docs/relational-databases/system-stored-procedures/sys-sp-flush-commit-table-transact-sql.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ This procedure must be run in a database that has change tracking enabled.
6868

6969
## See Also
7070

71-
[Change Tracking Stored Procedures (Transact-SQL)](../../relational-databases/system-stored-procedures/change-tracking-stored-procedures-transact-sql.md)
7271
[About Change Tracking (Transact-SQL)](../../relational-databases/track-changes/about-change-tracking-sql-server.md)
73-
[Change Tracking Cleanup (Transact-SQL)](../../relational-databases/track-changes/cleanup-and-troubleshooting-change-tracking-sql-server.md)
72+
[Change Tracking Cleanup and Troubleshooting (Transact-SQL)](../../relational-databases/track-changes/cleanup-and-troubleshooting-change-tracking-sql-server.md)
7473
[Change Tracking Functions (Transact-SQL)](../../relational-databases/system-functions/change-tracking-functions-transact-sql.md)
7574
[Change Tracking System Tables (Transact-SQL)](../../relational-databases/system-tables/change-tracking-tables-transact-sql.md)
75+
[Change Tracking Stored Procedures (Transact-SQL)](../../relational-databases/system-stored-procedures/change-tracking-stored-procedures-transact-sql.md)

docs/relational-databases/system-stored-procedures/sys-sp-flush-ct-internal-table-on-demand-transact-sql.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ Service Pack 4 for SQL Server 2012
8787

8888
## See Also
8989

90-
[Change Tracking Stored Procedures (Transact-SQL)](../../relational-databases/system-stored-procedures/change-tracking-stored-procedures-transact-sql.md)
9190
[About Change Tracking (Transact-SQL)](../../relational-databases/track-changes/about-change-tracking-sql-server.md)
92-
[Change Tracking Cleanup (Transact-SQL)](../../relational-databases/track-changes/cleanup-and-troubleshooting-change-tracking-sql-server.md)
91+
[Change Tracking Cleanup and Troubleshooting (Transact-SQL)](../../relational-databases/track-changes/cleanup-and-troubleshooting-change-tracking-sql-server.md)
9392
[Change Tracking Functions (Transact-SQL)](../../relational-databases/system-functions/change-tracking-functions-transact-sql.md)
9493
[Change Tracking System Tables (Transact-SQL)](../../relational-databases/system-tables/change-tracking-tables-transact-sql.md)
94+
[Change Tracking Stored Procedures (Transact-SQL)](../../relational-databases/system-stored-procedures/change-tracking-stored-procedures-transact-sql.md)

docs/relational-databases/system-tables/change-tracking-tables-transact-sql.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ ms.assetid:
2626
## See Also
2727

2828
[About Change Tracking (Transact-SQL)](../../relational-databases/track-changes/about-change-tracking-sql-server.md)
29-
[Change Tracking Cleanup (Transact-SQL)](../../relational-databases/track-changes/cleanup-and-troubleshooting-change-tracking-sql-server.md)
29+
[Change Tracking Cleanup and Troubleshooting (Transact-SQL)](../../relational-databases/track-changes/cleanup-and-troubleshooting-change-tracking-sql-server.md)
3030
[Change Tracking Functions (Transact-SQL)](../../relational-databases/system-functions/change-tracking-functions-transact-sql.md)
3131
[Change Tracking Stored Procedures (Transact-SQL)](../../relational-databases/system-stored-procedures/change-tracking-stored-procedures-transact-sql.md)

docs/relational-databases/system-tables/dbo-mschange_tracking_history-transact-sql.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@ This system table contains the history of Change Tracking cleanup jobs.
3636
## See Also
3737

3838
[About Change Tracking (Transact-SQL)](../../relational-databases/track-changes/about-change-tracking-sql-server.md)
39-
[Change Tracking Cleanup (Transact-SQL)](../../relational-databases/track-changes/cleanup-and-troubleshooting-change-tracking-sql-server.md)
39+
[Change Tracking Cleanup and Troubleshooting (Transact-SQL)](../../relational-databases/track-changes/cleanup-and-troubleshooting-change-tracking-sql-server.md)
4040
[Change Tracking Functions (Transact-SQL)](../../relational-databases/system-functions/change-tracking-functions-transact-sql.md)
4141
[Change Tracking Stored Procedures (Transact-SQL)](../../relational-databases/system-stored-procedures/change-tracking-stored-procedures-transact-sql.md)

docs/relational-databases/track-changes/about-change-tracking-sql-server.md

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
description: "About Change Tracking (SQL Server)"
33
title: "About Change Tracking"
44
ms.custom: seo-dt-2019
5-
ms.date: "08/08/2016"
5+
ms.date: "10/20/2016"
66
ms.prod: sql
77
ms.prod_service: "database-engine, sql-database"
88
ms.reviewer: ""
@@ -14,12 +14,13 @@ helpviewer_keywords:
1414
- "change tracking [SQL Server], about change tracking"
1515
- "change tracking [SQL Server]"
1616
- "data [SQL Server], changing"
17-
ms.assetid: 5e0ef05a-8317-4c98-be20-b19d4cd78f12
18-
author: MikeRayMSFT
19-
ms.author: mikeray
17+
ms.assetid:
18+
author: JetterMcTedder
19+
ms.author: bspendolini
2020
monikerRange: "=azuresqldb-current||>=sql-server-2016||>=sql-server-linux-2017||=azuresqldb-mi-current"
2121
---
2222
# About Change Tracking (SQL Server)
23+
2324
[!INCLUDE [SQL Server Azure SQL Database Azure SQL Managed Instance](../../includes/applies-to-version/sql-asdb-asdbmi.md)]
2425

2526
Change tracking is a lightweight solution that provides an efficient change tracking mechanism for applications. Typically, to enable applications to query for changes to data in a database and access information that is related to the changes, application developers had to implement custom change tracking mechanisms. Creating these mechanisms usually involved a lot of work and frequently involved using a combination of triggers, **timestamp** columns, new tables to store tracking information, and custom cleanup processes.
@@ -37,17 +38,20 @@ monikerRange: "=azuresqldb-current||>=sql-server-2016||>=sql-server-linux-2017||
3738
- The fact that a row has changed and information about the change must be available and recorded at the time that the change was made in the same transaction.
3839

3940
> [!NOTE]
40-
> If an application requires information about all the changes that were made and the intermediate values of the changed data, using change data capture, instead of change tracking, might be appropriate. For more information, see [About Change Data Capture (SQL Server)](../../relational-databases/track-changes/about-change-data-capture-sql-server.md).
41+
> If an application requires information about all the changes that were made and the intermediate values of the changed data, using change data capture, instead of change tracking, might be appropriate. For more information, see [About Change Data Capture (SQL Server)](../../relational-databases/track-changes/about-change-data-capture-sql-server.md).
4142
42-
## One-Way and Two-Way Synchronization Applications
43+
## One-Way and Two-Way Synchronization Applications
44+
4345
Applications that have to synchronize data with an instance of the [!INCLUDE[ssDEnoversion](../../includes/ssdenoversion-md.md)] must be able to query for changes. Change tracking can be used as a foundation for both one-way and two-way synchronization applications.
4446

45-
### One-Way Synchronization Applications
47+
### One-Way Synchronization Applications
48+
4649
One-way synchronization applications, such as a client or mid-tier caching application, can be built that use change tracking. As shown in the following illustration, a caching application requires data to be stored in the [!INCLUDE[ssDE](../../includes/ssde-md.md)] and to be cached in other data stores. The application must be able to keep the cache up-to-date with any changes that have been made to the database tables. There are no changes to pass back to the [!INCLUDE[ssDE](../../includes/ssde-md.md)].
4750

4851
![Shows one-way synchronization applications](../../relational-databases/track-changes/media/one-waysync.gif "Shows one-way synchronization applications")
4952

50-
### Two-Way Synchronization Applications
53+
### Two-Way Synchronization Applications
54+
5155
Two-way synchronization applications can also be built that use change tracking. In this scenario, the data in an instance of the [!INCLUDE[ssDE](../../includes/ssde-md.md)] is synchronized with one or more data stores. The data in those stores can be updated and the changes must be synchronized back to the [!INCLUDE[ssDE](../../includes/ssde-md.md)].
5256

5357
![Shows two-way synchronization applications](../../relational-databases/track-changes/media/two-waysync.gif "Shows two-way synchronization applications")
@@ -56,26 +60,30 @@ monikerRange: "=azuresqldb-current||>=sql-server-2016||>=sql-server-linux-2017||
5660

5761
The two-way synchronization applications must be able to detect conflicts. A conflict would occur if the same data was changed in both data stores in the time between synchronizations. With the ability to detect conflicts, an application can make sure that changes are not lost.
5862

59-
## How Change Tracking Works
63+
## How Change Tracking Works
64+
6065
To configure change tracking, you can use DDL statements or [!INCLUDE[ssManStudioFull](../../includes/ssmanstudiofull-md.md)]. For more information, see [Enable and Disable Change Tracking (SQL Server)](../../relational-databases/track-changes/enable-and-disable-change-tracking-sql-server.md). To track changes, change tracking must first be enabled for the database and then enabled for the tables that you want to track within that database. The table definition does not have to be changed in any way, and no triggers are created.
6166

6267
After change tracking is configured for a table, any DML statement that affects rows in the table will cause change tracking information for each modified row to be recorded. To query for the rows that have changed and to obtain information about the changes, you can use [change tracking functions](../../relational-databases/system-functions/change-tracking-functions-transact-sql.md).
6368

6469
The values of the primary key column is only information from the tracked table that is recorded with the change information. These values identify the rows that have been changed. To obtain the latest data for those rows, an application can use the primary key column values to join the source table with the tracked table.
6570

6671
Information about the change that was made to each row can also be obtained by using change tracking. For example, the type of DML operation that caused the change (insert, update, or delete) or the columns that were changed as part of an update operation.
67-
72+
6873
## Change Tracking Cleanup
74+
6975
Change tracking information for all tables (enabled for Change Tracking) is stored in an in-memory rowstore. Change tracking data associated with each table enabled for Change Tracking is flushed on every checkpoint from the in-memory rowstore to the corresponding on-disk internal table. During checkpoint, the in-memory rowstore is also purged after the rows are moved to the on-disk tables.
7076

7177
Each table that is enabled for Change Tracking has an internal on-disk table which is used by Change Tracking functions to determine the change version and the rows that have changed since a particular version. Every time the **auto cleanup** thread wakes up, it scans all the user databases on the SQL Server instance to identify the change tracking enabled databases. Based on the retention period setting of the database, each internal on-disk table is purged of its expired records.
7278

7379
A stored procedure was added in Service Packs for [!INCLUDE[ssSQL14](../../includes/sssql14-md.md)] and [!INCLUDE[sssql16-md](../../includes/sssql16-md.md)] for performing manual cleanup for the internal Change Tracking internal tables. More information about the stored procedure is available in [KB173157](https://support.microsoft.com/help/3173157/adds-a-stored-procedure-for-the-manual-cleanup-of-the-change-tracking-side-table-in-sql-server-2014-sp2-or-2016-sp1).
7480

75-
## See Also
81+
## See Also
82+
7683
[Enable and Disable Change Tracking (SQL Server)](../../relational-databases/track-changes/enable-and-disable-change-tracking-sql-server.md)
7784
[Work with Change Tracking (SQL Server)](../../relational-databases/track-changes/work-with-change-tracking-sql-server.md)
7885
[Manage Change Tracking (SQL Server)](../../relational-databases/track-changes/manage-change-tracking-sql-server.md)
86+
[Change Tracking Cleanup and Troubleshooting (Transact-SQL)](../../relational-databases/track-changes/cleanup-and-troubleshooting-change-tracking-sql-server.md)
7987
[Track Data Changes (SQL Server)](../../relational-databases/track-changes/track-data-changes-sql-server.md)
8088
[Change Tracking Stored Procedures (Transact-SQL)](../../relational-databases/system-stored-procedures/change-tracking-stored-procedures-transact-sql.md)
8189
[Change Tracking System Tables (Transact-SQL)](../../relational-databases/system-tables/change-tracking-tables-transact-sql.md)

docs/relational-databases/track-changes/cleanup-and-troubleshooting-change-tracking-sql-server.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ The sp_flush_CT_internal_table_on_demand stored procedure will do the following:
6969

7070
## Creating Extended Events for Change Tracking
7171

72-
Note: Extended Events Are Not Available With Azure SQL Database
72+
> [!NOTE]
73+
> Extended Events Are Not Available With Azure SQL Database
7374
7475
[Extended Events](../../relational-databases/extended-events/extended-events.md) can be used for monitoring and alerting with Change Tracking and can be created with [SQL Server Management Studio (SSMS)](../../relational-databases/extended-events/quick-start-extended-events-in-sql-server.md).
7576

0 commit comments

Comments
 (0)