SQL Server sink connector Use the SQL Server sink connector to get data from your Decodable streams to your Microsoft SQL Server Database. Features Delivery guarantee Exactly once Read from multiple streams Yes Prerequisites The SQL Server database must be accessible from the Decodable network. You must have a SQL Server user with the following privilege: CREATE TABLE Steps If you want to use the Decodable CLI or API to create the connection, you can refer to the Property Name column for information about what the underlying property names are. The connector name is sqlserver. From the Connections page, select Microsoft SQL Server and complete the following fields. UI Field Property Name Description Host hostname The host name for your SQL Server database. Port port Optional. The port number to use when connecting to the host. Defaults to 1433. Database database-name The name of the database to connect to. Schema schema-name The name of the schema to which the tables should be written. Username username The username to use to authenticate to SQL Server. Password password The password associated with the username. This must be provided as a secret resource. Encrypt connection encrypt Use Transport Layer Security (TLS) encryption. Trust server certificate trustServerCertificate If encrypt is true, don’t validate the server TLS certificate. Select Next. The next screen shows the list of Decodable streams in your account. Select the streams that you want to send to SQL Server. Decodable automatically creates a table in your database for each stream selected. By default, Decodable uses the stream name as the name of the table it creates. If a table already exists with that name and the schema of the stream matches the schema of the table, Decodable will write to the existing table. The schema of each stream is automatically translated to SQL Server, including: field names data types (See Data types mapping for how Decodable types map to SQL Server types) primary keys (Optional) If you want to rename the tables to be created, you can override the generated table names. Select Next. Give the newly created connection a Name and Description. Then, select Save. Connector starting state and offsets A new sink connection will start reading from the Latest point in the source Decodable stream. This means that only data that’s written to the stream when the connection has started will be sent to the external system. You can override this when you start the connection to Earliest if you want to send all the existing data on the source stream to the target system, along with all new data that arrives on the stream. When you restart a sink connection it will continue to read data from the point it most recently stored in the checkpoint before the connection stopped. You can also opt to discard the connection’s state and restart it afresh from Earliest or Latest as described above. Learn more about starting state here. Data types mapping The table below shows the mapping from Decodable data types to SQL Server data types. Decodable Type SQL Server Type CHAR(n) NCHAR(n) VARCHAR(n) NVARCHAR(n) STRING NVARCHAR(MAX) BOOLEAN BIT BINARY(n) BINARY(n) VARBINARY(n) VARBINARY(n) DECIMAL(p, s) DECIMAL(p, s) TINYINT SMALLINT SMALLINT SMALLINT INT/INTEGER INT BIGINT BIGINT FLOAT FLOAT(24) DOUBLE [PRECISION] FLOAT DATE DATE TIME(p) TIME(p) TIMESTAMP(p) [WITHOUT TIME ZONE] (p = 0) SMALLDATETIME TIMESTAMP(p) [WITHOUT TIME ZONE] (0 < p <= 9) DATETIME2(p) TIMESTAMP(p) WITH LOCAL TIME ZONE (0 <= p <= 9) DATETIMEOFFSET(p) TIMESTAMP_LTZ(p) (0 <= p <= 9) DATETIMEOFFSET(p) Resource specifier keys When using the connection scan command of the Decodable CLI to create a connection specification, the following resource specifier keys are available: Name Description table-name The table name