.. _ms-sql-source-connector: |kconnect-long| Microsoft SQL Server Source Connector ===================================================== .. important:: **This connector is no longer available or supported by Confluent.** Please use the :ref:`Debezium SQL Server Source Connector <sqlserver-source-connector>`. You can use the Microsoft SQL Server Connector to monitor source databases for changes and write them in realtime to Kafka. The Microsoft SQL Server connector utilizes `Change Tracking <https://msdn.microsoft.com/en-us/library/bb933875.aspx>`_ to identify changes. There are two ways to read the changes from the source system as they are generated. `Change Data Capture <https://msdn.microsoft.com/en-us/library/cc645937.aspx>`_ is a feature that is only available on SQL Server Enterprise and Developer editions. `Change Tracking <https://msdn.microsoft.com/en-us/library/bb933875.aspx>`_ is a lightweight solution that will efficiently find rows that have changed. If the rows are modified in quick succession all of the changes might not be found. The latest version of the change will be returned. .. include:: ../includes/evaluation-license.rst Install the Microsoft SQL Server Connector ------------------------------------------ .. include:: ../includes/connector-install.rst .. include:: ../includes/connector-install-hub.rst .. codewithvars:: bash confluent-hub install confluentinc/kafka-connect-cdc-mssql:latest .. include:: ../includes/connector-install-version.rst .. codewithvars:: bash confluent-hub install confluentinc/kafka-connect-cdc-mssql:1.0.1-preview -------------------------- Install Connector Manually -------------------------- `Download and extract the ZIP file <https://www.confluent.io/connector/kafka-connect-cdc-microsoft-sql/>`_ for your connector and then follow the manual connector installation :ref:`instructions <connect_install_connectors>`. License ------- .. include:: ../includes/evaluation-license.rst For more information, see :ref:`ms-sql-source-connector`. Usage Notes ----------- This connector works only for SQL Server databases using **case insensitive** collation. That is, uppercase and lowercase letters are considered to be identical for sorting purposes. The connector does not work for SQL databases using case sensitive collation. :ref:`Tasks <connect_tasks>` are used to spread the work across the |kconnect| cluster. The connector will partition all of the tables with Change Tracking enabled across the number of tasks allocated to the connector. Each task will have at least one connection to the source database server. This connector utilizes the `Change Tracking <https://msdn.microsoft.com/en-us/library/bb933875.aspx>`_ feature available in most versions of SQL Server. For this connector to detect changes you must `enable Change Tracking <https://docs.microsoft.com/en-us/sql/relational-databases/track-changes/enable-and-disable-change-tracking-sql-server>`_ on the source database server. .. _ms-sql-source-connector-examples: Examples -------- ------- Minimal ------- This example will connect to a database server and use any table configured with change tracking. .. note:: Increasing `tasks.max` will help increase the speed at which changes are imported. This comes with the side affect of increased connections/load on the source SQL Server. Select one of the following configuration methods based on how you have deployed |kconnect-long|. Distributed Mode will the JSON / REST examples. Standalone mode will use the properties based example. **Distributed Mode JSON** .. literalinclude:: MsSqlSourceConnector.minimal.example.json :language: JSON **Standalone Mode Properties** .. literalinclude:: MsSqlSourceConnector.minimal.example.properties :language: properties --------------- Specific Tables --------------- This example will connect to a SQL Server and will only check for changes from specific tables. Select one of the following configuration methods based on how you have deployed |kconnect-long|. Distributed Mode will the JSON / REST examples. Standalone mode will use the properties based example. **Distributed Mode JSON** .. literalinclude:: MsSqlSourceConnector.specific_tables.example.json :language: JSON **Standalone Mode Properties** .. literalinclude:: MsSqlSourceConnector.specific_tables.example.properties :language: properties .. toctree:: :maxdepth: 1 :hidden: ms_sql_source_connector_config