Type | Supported Version |
Self-Built SQL Server | 2012 / 2014 / 2016 / 2017 / 2019 / 2022 |
TencentDB for SQL Server | 2012 / 2014 / 2016 / 2017 / 2019 / 2022 |
JDBC Driver | mssql-jdbc-7.4.1.jre8 |
Capability | Offline read | Real-time full database read | Sharded database and table read |
Supported | ✓ | ✓ | ✓ |
Limit | Description |
CDC Feature | Enable CDC (Change Data Capture) on the database and tables. |
Log Retention Period | CDC logs are retained for at least 72 hours. |
Table without primary key | Tables without primary keys cannot guarantee exactly-once semantics. |
Version Requirement | CDC is available only in Enterprise / Developer / Standard editions. |
Lock Contention | Enable snapshot isolation to avoid lock contention. |
Limit | Description |
View | Supports view reading |
Split Key | Only integer fields are supported. |
Field Type | Offline read | Real-time read |
BIT / TINYINT / SMALLINT / INT / INTEGER / BIGINT | ✅ | ✅ |
FLOAT / REAL / DECIMAL / NUMERIC / MONEY / SMALLMONEY | ✅ | ✅ |
CHAR / NCHAR / VARCHAR / NVARCHAR / TEXT / NTEXT / XML | ✅ | ✅ |
DATE / TIME / DATETIME / DATETIME2 / SMALLDATETIME / DATETIMEOFFSET | ✅ | ✅ |
BINARY / VARBINARY / IMAGE / UNIQUEIDENTIFIER | ✅ | ✅ |
GEOGRAPHY / GEOMETRY / HIERARCHYID / SQL_VARIANT | ❌ | ❌ |
Operation | Whether Supported |
INSERT / DELETE / UPDATE | ✅ |
Operation | Whether Supported |
Add column / Delete column / Rename column / Modify column type | ❌ |
Add table / Rename table / Delete table / Clear table | ❌ |
CREATE LOGIN wedata_user WITH PASSWORD = 'your_password';USE your_database;CREATE USER wedata_user FOR LOGIN wedata_user;GRANT SELECT ON SCHEMA::dbo TO wedata_user;
CREATE LOGIN wedata_cdc_user WITH PASSWORD = 'your_password';USE your_database;CREATE USER wedata_cdc_user FOR LOGIN wedata_cdc_user;GRANT SELECT ON SCHEMA::dbo TO wedata_cdc_user;GRANT SELECT ON SCHEMA::cdc TO wedata_cdc_user;ALTER ROLE db_datareader ADD MEMBER wedata_cdc_user;
USE your_database;EXEC sys.sp_cdc_enable_db;EXEC sys.sp_cdc_enable_table@source_schema = N'dbo',@source_name = N'your_table',@role_name = NULL,@supports_net_changes = 1;
EXEC sys.sp_cdc_help_jobs;
ALTER DATABASE your_database SET ALLOW_SNAPSHOT_ISOLATION ON;ALTER DATABASE your_database SET READ_COMMITTED_SNAPSHOT ON;
Parameter | Description | Required |
Data Source Name | Unique identifier of the data source within the workspace | Yes |
JDBC URL | jdbc:sqlserver://host:port;DatabaseName=database | Yes |
Username. | Database connection account | Yes |
Password | Database connection password (SSM credential hosting supported) | Yes |
Data Source Version | Yes |
jdbc:sqlserver://10.0.0.1:1433;databaseName=mydbjdbc:sqlserver://10.0.0.1:1433;databaseName=mydb;encrypt=true;trustServerCertificate=true
Parameter | Description |
databaseName | Database name. |
encrypt / trustServerCertificate | Related to encrypted connections |
loginTimeout | Login timeout (seconds) |
Configuration Item | Description |
Source Table Scope | Specified tables (only selected tables are synchronized; new tables require a restart) / regex matching (specify database name + table name regex; new tables that match the rule are automatically added). |
Read Mode | Full + incremental / Incremental only |
Parameter | Description |
Database / Schema / Table | Required. Schema defaults to dbo |
Split Key | Only integer fields are supported. |
Filtering Condition | Standard WHERE syntax |
sa.EXEC sys.sp_cdc_change_job@job_type = 'cleanup',@retention = 4320; -- Unit: minutes (72 hours)
USE your_database;EXEC sys.sp_cdc_enable_db;EXEC sys.sp_cdc_enable_table@source_schema = N'dbo',@source_name = N'your_table',@role_name = NULL;
EXEC sys.sp_cdc_help_jobs;.ALTER DATABASE your_database SET ALLOW_SNAPSHOT_ISOLATION ON;ALTER DATABASE your_database SET READ_COMMITTED_SNAPSHOT ON;
フィードバック