- JDBC connector (
connector='jdbc') - Recommended for better performance - SQL Server native connector (
connector='sqlserver')
sqlserver_sink.slt demo in the e2e_test directory of the RisingWave repository.
Prerequisites
Before sinking data from RisingWave to SQL Server, please ensure the following:- The SQL Server table you want to sink to is accessible from RisingWave.
- You have an upstream materialized view or table in RisingWave that you can sink data from.
- For the SQL Server native connector, the SQL Server user must be able to inspect the target table metadata. During sink creation, RisingWave validates the target columns, data types, and primary key definition against the downstream table.
- For the SQL Server native connector, append-only sinks require
INSERTpermission on the target table. Upsert sinks requireINSERT,UPDATE, andDELETEpermissions. - If you are running RisingWave locally from binaries and intend to use the JDBC sink connector, make sure you have JDK 11 or later versions installed in your environment.
Create a sink
RisingWave supports two connector types for SQL Server sinks. The JDBC connector is recommended for better performance.Syntax
Parameters (JDBC connector)
Parameters (SQL Server native connector)
For native SQL Server sinks, RisingWave validates the downstream table when you create the sink:
- Sink columns must exist in the target SQL Server table and use compatible data types.
- For upsert sinks, the
primary_keysetting must match the target table primary key columns. timestamptzcolumns are written according to the target SQL Server column type:datetimeoffsetstores an offset-aware timestamp.datetime,datetime2, andsmalldatetimestore a UTC timestamp without offset.bigint,int,smallint, andtinyintstore microsecond epoch values.
Examples
jdbc as connector
sqlserver as connector