Change Data Capture - sys.dm_cdc_errors

Applies to: SQL Server Azure SQL Database Azure SQL Managed Instance

Returns one row for each error encountered during the change data capture log scan session.

Column name Data type Description
session_id int ID of the session.

0 = the error did not occur within a log scan session.
phase_number int Number indicating the phase the session was in at the time the error occurred. For a description of each phase, see sys.dm_cdc_log_scan_sessions (Transact-SQL).
entry_time datetime The date and time the error was logged. This value corresponds to the timestamp in the SQL error log.
error_number int ID of the error message.
error_severity int Severity level of the message, between 1 and 25.
error_state int State number of the error.
error_message nvarchar(1024) Message text of the error.
start_lsn nvarchar(23) Starting LSN value of the rows being processed when the error occurred.

0 = the error did not occur within a log scan session.
begin_lsn nvarchar(23) Beginning LSN value of the transaction being processed when the error occurred.

0 = the error did not occur within a log scan session.
sequence_value nvarchar(23) LSN value of the rows being processed when the error occurred.

0 = the error did not occur within a log scan session.

Remarks

The DMV sys.dm_cdc_errors contains error information for the previous 32 sessions.

Permissions

Requires VIEW DATABASE STATE permission to query the sys.dm_cdc_errors dynamic management view. For more information about permissions on dynamic management views, see Dynamic Management Views and Functions (Transact-SQL).

Permissions for SQL Server 2022 and later

Requires VIEW DATABASE PERFORMANCE STATE permission on the database.

Next steps