Generic SQL Server
On This Page
Microsoft SQL (MS SQL) Server is a popular Relational Database Management System (RDBMS) used by small and large businesses. It can store and retrieve data as requested by software applications.
You can ingest data from your MS SQL Server using Hevo Pipelines and replicate it to a warehouse of your choice.
Prerequisites
-
The MS SQL Server is running.
-
MS SQL version is 12 or higher.
-
TCP/IP Protocol is enabled with TCP port as 1433.
-
VIEW CHANGE TRACKING, and ALTER DATABASE privileges are granted to the database user, if Pipeline Mode is Change Tracking or Table, and Query mode is Change Tracking.
-
SELECT privileges are granted to the database user.
Perform the following steps to configure your Generic MS SQL Source:
Enable TCP/IP Protocol
You need to configure the MS SQL Server instance with TCP port value 1433 to enable Hevo to connect to your MS SQL Server.
Follow these steps to enable TCP/IP protocol for your MS SQL Server:
1. Enable the TCP/IP port
-
Open the SQL Server Configuration Manager.
-
In the left navigation pane under SQL Server Network Configuration, click Protocols for <MS SQL Server Instance Name>. The default instance name is MSSQLSERVER.
-
In the right pane, right click the TCP/IP Protocol Name, and select Enable (if not enabled already) in the Status field.
-
Click OK to acknowledge the dialogue box that warns you to restart the services for the changes to take effect.
2. Verify the TCP/IP port
Follow these steps to check the port where TCP/IP is enabled:
-
Right-click the TCP/IP Protocol Name, and select Properties.
-
In the TCP/IP Properties window, click the IP Addresses tab.
-
In the IPAII section, ensure the TCP Port value is 1433, which is the default port for MS SQL Server.
-
Click OK to acknowledge the dialogue box that warns you to restart the services for the changes to take effect.
-
Click OK, and exit the TCP/IP Properties window.
3. Restart the MS SQL Server instance
-
In the left navigation pane, click SQL Server Services.
-
In the right pane, right-click your < MS SQL Server Instance Name >, and select Restart.
Enable Change Tracking
The Change Tracking mechanism captures changes made to a database. In order to enable, or disable change tracking, the database user must have the ALTER DATABASE
privilege.
To enable change tracking, connect your MS SQL Server in your SQL Client tool, and enter these commands:
-
Enable change tracking at the database level:
ALTER DATABASE [<database>] SET CHANGE_TRACKING = ON;
-
Enable change tracking for each table you want to integrate:
ALTER TABLE [<schema>].[<table>] ENABLE CHANGE_TRACKING;
Grant Privileges to the User
The database user specified in the Hevo Pipeline must have the following global privileges:
-
SELECT
-
VIEW CHANGE TRACKING
(If Pipeline Mode is Change Tracking or Table, and Query mode is Change Tracking)
To set up these privileges, connect your MS SQL Server in your SQL Client tool, and enter these commands:
-
Grant
SELECT
privilege at the table and schema level:GRANT SELECT ON <schema_name>.<table_name> TO <username>;
-
Grant
VIEW CHANGE TRACKING
privilege, if Pipeline Mode is Change Tracking or Table, and Query mode is Change Tracking:GRANT VIEW CHANGE TRACKING ON <schema_name>.<table_name> TO <username>;
Specify Generic SQL Server Connection Settings
In the Configure your SQL Server Source page, specify the following:
-
Pipeline Name: A unique name for the Pipeline.
-
SQL Server Host: SQL Server host’s IP address or DNS.
The following table lists a few examples of SQL Server hosts:
Variant Host Amazon RDS MS SQL ms-sql-server-1.xxxxx.rds.amazonaws.com Azure MS SQL mssql.database.windows.net Generic MS SQL 10.123.10.001 or mssql.westeros.inc Google Cloud SQL Server 35.220.150.0 Note: For URL-based hostnames, exclude the http:// or https:// part. For example, if the hostname URL is https://mssql.database.windows.net, enter mssql.database.windows.net.
-
SQL Server Port: The port on which your SQL Server is listening for connections. Default value: 1433.
-
SQL Server User: The read-only user who has the permissions to read tables in your database.
-
SQL Server Password: The password for the read-only user.
-
Select an Ingestion Mode: The desired mode by which you want to ingest data from the Source. The available Ingestion Modes are Change Tracking, Table, and Custom SQL. Read Ingestion Modes.
For Ingestion mode as Table, read Object Settings for steps to configure the objects to be replicated.
-
Database Name: The database that you wish to replicate.
-
Schema Name: The schema that holds the tables to be replicated. Default value: dbo.
-
Connect through SSH: Enable this option to connect to Hevo using an SSH tunnel, instead of directly connecting your SQL Server database host to Hevo. This provides an additional level of security to your database by not exposing your SQL Server setup to the public. Read Connecting Through SSH.
If this option is disabled, you must whitelist Hevo’s IP addresses. Refer to the content for your SQL Server variant for steps to do this.
-
Advanced Settings:
- Include New Tables in the Pipeline: Applicable for all Ingestion modes except Custom SQL. If enabled, Hevo automatically ingests data from tables created after the Pipeline has been built. If disabled, the new tables are listed in the Pipeline Detailed View in Skipped state, and you can manually include the ones you want and load their historical data.
You can change this setting later.
-
Click TEST & CONTINUE to proceed for setting up the Destination.
Connecting to a Local Database
Refer to this section for steps to connect to your local database. For detailed information and troubleshooting help, read Connecting to a LocalHost Database.
Prerequisites
-
MY-SQL/MS-SQL service is running on your local machine.
-
Data to be loaded to the Destination is available in your MY-SQL/MS-SQL database.
-
You have an account on ngrok and an installed ngrok utility on your local machine. To run ngrok on your local machine, follow these one-time steps:
-
Extract the ngrok utility:
-
On Linux or MacOS, unzip ngrok from a terminal:
unzip /path/to/ngrok.zip
-
On Windows, double-click ngrok.zip to extract it.
-
-
Authenticate ngrok in your local machine:
./ngrok authtoken <your_auth_token>
You can get the auth token from your ngrok dashboard. For example, in the image below, the auth_token starts with
1t7uGaJshUvnh2Fg1MApl
.
-
Connect to the local database
Perform the following steps to connect to the local database:
-
Log in to your database server.
-
Start a TCP tunnel forwarding to your database port.
./ngrok tcp <your_database_port>
For example, the port address for MySQL is 3306. Therefore, the command would be:
./ngrok tcp 3306
-
Copy the public IP address (hostname and port number) for your local database and port. For example, in the image below,
8.tcp.ngrok.io
is the database hostname and19789
is the port number. -
Paste the hostname and port number into the Database Host and Database Port fields respectively.
-
Specify all other settings and click TEST & CONTINUE.
Limitations
None.
Revision History
Refer to the following table for the list of key updates made to this page:
Date | Release | Description of Change |
---|---|---|
Apr-21-2022 | 1.86 | Updated section, Specify Generic SQL Server Connection Settings. |
Sep-08-2021 | NA | - Updated the fourth list item under Prerequisites - Updated sub-section Grant privileges to the user. |
Jul-26-2021 | 1.68 | Added a note for the SQL Server Host field. |
Jul-12-2021 | 1.67 | Added sections: - Specify Generic MS SQL Connection Settings - Connecting to a Local Database. |
Mar-09-2021 | 1.58 | Replaced references to Logical Replication with Change Tracking as Change Tracking is a distinct Pipeline mode for SQL Server Source types. |