Loading Data from Microsoft SQL Server

This section describes how to connect Microsoft SQL Server with Exasol and then load data. To view details about data type mappings or to migrate data, see the SQL Server to Exasol migration script in our GitHub repository.

Additionally, you can also use the jTDS driver, which is an open source Java type 4 JDBC driver for Microsoft SQL Server, to connect to Exasol.

Download Driver

  • You can download the JDBC driver for SQL Server from the Microsoft JDBC download page. To know the JDBC driver compatible with your database version, refer to the JDBC driver support matrix and policy on the Microsoft documentation site.

    Only open source and Java 8 (.jre8) JDBC drivers are supported.

  • You can download the jTDS driver for SQL Server from the Sourceforge website.

Configure JDBC Driver in EXAoperation

Follow these steps to configure the JDBC driver for SQL Server in EXAoperation:

  1. Log in to EXAoperation user interface as an Administrator user.
  2. Select Configuration > Software and click the JDBC Drivers tab.
  3. Click Add to add the JDBC driver details.
  4. Enter the following details for the JDBC properties:
    • Driver Name: MSSQL
    • Main Class: com.microsoft.sqlserver.jdbc.SQLServerDriver
    • Prefix: jdbc:sqlserver:
    • Disable Security Manager: Leave this option unchecked.
    • Comment: This is an optional field.
  5. Click Add to save the settings.
  6. Click Choose File to locate the downloaded driver and click Upload to upload the JDBC driver.

Configure jTDS JDBC Driver in EXAoperation

Follow these step to configure the jTDS JDBC driver in EXAoperation:

  1. Log in to EXAoperation user interface as an Administrator user.
  2. Select Configuration > Software and click the JDBC Drivers tab.
  3. Click Add to add the JDBC driver details.
  4. Enter the following details for the JDBC properties:
    • Driver Name: JTDSMSSQL
    • Main Class: net.sourceforge.jtds.jdbc.Driver
    • Prefix: jdbc:jtds:sqlserver:
    • Disable Security Manager: Leave this option unchecked.
    • Comment: This is an optional field.
  5. Click Add to save the settings.
  6. From list of JDBC drivers, select the radio button next to the desired driver.
  7. Click Choose File to locate the downloaded driver and click Upload to upload the JDBC driver.

For additional information, refer to the JTDS Driver section in this Exasol Knowledge Base article that describes best practices for using IMPORT/EXPORT with SQL Server.

Run Statement for MSSQL JDBC Driver

Run the following statement to create a connection.

CREATE OR REPLACE CONNECTION JDBC_SQLSERVER
    TO 'jdbc:sqlserver://192.168.99.100:1433;databaseName=master;instance=v1'
    USER 'user'
    IDENTIFIED BY 'Password';

Run the following statement to test the connection.

select * from 
(
import from JDBC at JDBC_SQLSERVER
statement 'select ''Connection works'' '
);

Run Statement for jTDS JDBC Driver

The jTDS connection string format used to connect to SQL Server is as follows: 

jdbc:jtds:sqlserver://{SERVER_NAME};databaseName={DATABASE_NAME);instance={INSTANCE}

Run the following statement to create a connection.

CREATE OR REPLACE CONNECTION JDBC_SQLSERVER
    TO 'jdbc:jtds:sqlserver://192.168.99.100:1433;databaseName=master;instance=v1'
    USER 'user'
    IDENTIFIED BY 'Password';

Run the following statement to test the connection.

select * from 
(
import from JDBC at JDBC_SQLSERVER
statement 'select ''Connection works'' '
);

Load Data

You can use the IMPORT statement to load data using the connection you created above. IMPORT supports loading data from a table or a SQL statement.