Skip to main content
This guide covers two connector options for sinking data to SQL Server:
  • JDBC connector (connector='jdbc') - Recommended for better performance
  • SQL Server native connector (connector='sqlserver')
You can test out this process on your own device by using the sqlserver_sink.slt demo in the e2e_test directory of the RisingWave repository.
PREMIUM FEATUREThis is a premium feature. For a comprehensive overview of all premium features and their usage, please see RisingWave premium features.

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 INSERT permission on the target table. Upsert sinks require INSERT, UPDATE, and DELETE permissions.
  • 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_key setting must match the target table primary key columns.
  • timestamptz columns are written according to the target SQL Server column type:
    • datetimeoffset stores an offset-aware timestamp.
    • datetime, datetime2, and smalldatetime store a UTC timestamp without offset.
    • bigint, int, smallint, and tinyint store microsecond epoch values.

Examples

jdbc as connector
sqlserver as connector

Data type mapping

The following table shows the corresponding data types between RisingWave and SQL Server that should be specified when creating a sink. For details on native RisingWave data types, see Overview of data types.