Search results

Microsoft SQL Server

Structured Query Language (SQL) is a programming language for storing and processing information in a relational database. A relational database stores information in tabular form, with rows and columns representing different data attributes and the various relationships between the data values.

Prerequisite

  • ODBC Driver 17+ for SQL Server

Connection Properties

The config section in a YAML file includes the following properties:

Connectorname: SQL
host: Hostname or IP address of the server
port: Server running port
username: Username
password: Password
database: Database
drivername: mssql+pyodbc

Configure the Bold Data Hub to connect MSSQL Server

  1. Click the Data Hub icon on the Navigation Pane.

sql ETL- BoldBI

  1. Click Add Project and provide the new project’s name.

sql ETL- BoldBI

  1. Select the newly created project and add the MSSQL template.

sql ETL- BoldBI

Configuration Parameters

Parameters Description
Host: Specify the hostname of the MSSQL server.
Port: Specify the port number of the MSSQL server (default is 1433).
Username: Provide the username to authenticate with the MSSQL server.
Password: Provide the password to authenticate with the MSSQL server.
Database: Specify the name of the MSSQL database from which data will be extracted.
Driver Name: Specify the driver name for connecting to MSSQL (e.g., mssql+pyodbc).
Driver: Specify the ODBC driver to use for connecting to MSSQL (e.g., ODBC+Driver+17+for+SQL+Server).
Select Tablename(s): Specify the name of the table(s) to load tables from the MSSQL server.
Metadata (Optional) Replication Method: Specify the replication method for the table(s). Options include FULL or INCREMENTAL.
Replication Key: Specify the replication key for incremental replication. This key helps in identifying new or updated records.
Replication Value: Specify the replication value to start the incremental replication from a particular point.
  1. Update the details required in the template. and save it to the BoldBI Data Store.

sql ETL- BoldBI

Schedule Bold Data Hub Job

  1. Click Schedules and select the created sql project.

sql ETL- BoldBI

  1. For an on-demand refresh, click Run Now.

sql ETL- BoldBI

  1. After, Complete the on-demand refresh.

sql ETL- BoldBI

  1. Click the Schedule option to schedule the refresh hourly.

sql ETL- BoldBI

  1. The data source was created by Bold Data Hub in Bold BI.

sql ETL- BoldBI

  1. Click Edit DataSource Option to view the created table(s), such as ‘sample’ table.

sql ETL- BoldBI

Metadata Properties

In the metadata section, define the mode of data refresh. There are two modes: INCREMENTAL and FULL_TABLE.

INCREMENTAL

This mode fetches data from the date column mentioned in the replication key from the start date as mentioned in the replication value. Once it is scheduled, the replication value is updated automatically from the imported data.

metadata:
  TableName:
    replication_method: INCREMENTAL
    replication_key: Column name
    replication_value: column value that data starts from

FULL_TABLE

This mode fetches data from the date column mentioned in the replication key from the start date as mentioned in the replication value. Once it is scheduled, the replication value is updated automatically from the imported data.

metadata:
  TableName:
    replication_method: FULL_TABLE
    replication_key: Column name
    replication_value: column value that data starts from
    interval_type: days/hours/minutes/year/month
    interval_value: integer value to add in interval type

Example Configuration

Incremental

version: 1
encrypt_credentials: false
plugins:
  extractors:
    - name: tap_postgres
      connectorname: MSSQL
      config:
        host: Hostname or IP address of the server
        port: Server running port
        username: Username
        password: Password
        database: Database
        drivername: mssql+pyodbc
        #if ODBC Driver 18 for SQL Server is installed, use the following driver: ODBC+Driver+18+for+SQL+Server
        driver: ODBC+Driver+17+for+SQL+Server 
      select:
        - TABLE1
        - TABLE2
      metadata:
        TABLE1:
          replication_method: INCREMENTAL
          replication_key: last_modified_on
          replication_value: 2023-07-19 00:00:00
        TABLE2:
          replication_method: INCREMENTAL
          replication_key: last_modified_on
          replication_value: 2023-07-19 00:00:00

FULLTABLE

version: 1
encrypt_credentials: false
plugins:
  extractors:
    - name: tap_postgres
      connectorname: MSSQL
      config:
        host: Hostname or IP address of the server
        port: Server running port
        username: Username
        password: Password
        database: Database
        drivername: mssql+pyodbc
        #if ODBC Driver 18 for SQL Server is installed, use the following driver: ODBC+Driver+18+for+SQL+Server
        driver: ODBC+Driver+17+for+SQL+Server 
      select:
        - TABLE1
        - TABLE2
      metadata:
        TABLE1:
          replication_method: FULL_TABLE
          replication_key: last_modified_on
          replication_value: 2023-07-19 00:00:00
          interval_type: days
          interval_value: 6
        TABLE2:
          replication_method: FULL_TABLE
          replication_key: last_modified_on
          replication_value: 2023-07-19 00:00:00
          interval_type: days
          interval_value: 6