# Integrate Microsoft SQL Server with Databox

Microsoft SQL Server is a widely used relational database management system (RDBMS) that stores and retrieves structured data using T-SQL. It powers everything from small business applications to large-scale enterprise systems and is commonly deployed on-premises on Windows or Linux servers. Connecting SQL Server to Databox lets you pull data directly from your database, build custom metrics using SQL queries, and visualize business-critical figures alongside data from your other connected tools.

This article covers self-hosted SQL Server instances. If you are using a managed SQL Server service, see the dedicated article for your provider: [Amazon RDS for SQL Server](/integrate-amazon-rds-for-sql-server-with-databox), [Google Cloud for SQL Server](/integrate-google-cloud-for-sql-server-with-databox), or [Microsoft Azure](/integrate-microsoft-azure-with-databox).

## Connection

If you've already established a connection, you can [reuse](/add-a-data-source) it to add new data sources to your Databox account.

### Step 1: Create a read-only SQL Server login for Databox

Databox only reads data from your database — it never writes to it. Create a dedicated SQL Server login with `SELECT`-only permissions scoped to the database you want to connect.


```sql
CREATE LOGIN databox WITH PASSWORD = 'your_secure_password';
GO
USE your_database;
GO
CREATE USER databox FOR LOGIN databox;
GO
GRANT SELECT ON SCHEMA::dbo TO databox;
GO
```

Replace `your_database` with the name of the database you want to connect, and `your_secure_password` with a strong password. If you need to grant access to additional schemas, repeat the `GRANT SELECT ON SCHEMA` statement for each one.

Avoid the following special characters in your SQL Server password, as they can cause encoding issues when establishing the connection: ```, `'`, `"`, `/`, `\`, and spaces.

### Step 2: Configure SQL Server to accept remote connections

By default, SQL Server may have the TCP/IP protocol disabled or listening only on a dynamic port. To allow Databox to connect, enable TCP/IP and set a fixed port using SQL Server Configuration Manager.

1. Open **SQL Server Configuration Manager**. You can find it in the Start menu, or run `SQLServerManager{version}.msc` (e.g., `SQLServerManager16.msc` for SQL Server 2022).
2. In the left pane, expand **SQL Server Network Configuration** and click **Protocols for {your instance name}**.
3. Right-click **TCP/IP** and select **Enable**.
4. Double-click **TCP/IP** and open the **IP Addresses** tab.
5. Scroll to the **IPAll** section at the bottom:
  - Clear the **TCP Dynamic Ports** field (set it to blank).
  - Set **TCP Port** to `1433`.
6. Click **OK**.
7. In the left pane, click **SQL Server Services**, right-click your SQL Server instance, and select **Restart** to apply the changes.


If you are running a named SQL Server instance (e.g., `SERVERNAME\INSTANCENAME`), make sure the **SQL Server Browser** service is running — it is required for clients to resolve named instances. You can start it from the **SQL Server Services** node in SQL Server Configuration Manager.

### Step 3: Whitelist the Databox IP address

Open port `1433/TCP` for inbound connections from the Databox IP address `52.4.198.118` on your server's firewall. The exact steps depend on your infrastructure:

**Windows Firewall (Command Prompt, run as Administrator):**


```
netsh advfirewall firewall add rule name="Databox SQL Server" protocol=TCP dir=in localport=1433 action=allow remoteip=52.4.198.118
```

**Linux (iptables):**


```bash
iptables -A INPUT -s 52.4.198.118/32 -p tcp --dport 1433 -j ACCEPT
```

**Cloud-hosted VM (AWS, Azure, Google Cloud):** Add an inbound rule to your instance's network security group or firewall policy allowing TCP on port `1433` from `52.4.198.118/32`.

### Step 4: Enter your SQL Server connection details in Databox

1. In Databox, go to **Data Sources > + New connection**.
2. Search for **Microsoft SQL Server** and click **Connect**.
3. Fill in the connection form:
  - **Data source name** — a label for this connection in Databox.
  - **Server name** — the hostname or IP address of your SQL Server.
  - **Port** — the port SQL Server listens on. The default is `1433`.
  - **Username** — the SQL Server login name created in [Step 1](#step-1-create-a-read-only-sql-server-login-for-databox).
  - **Password** — the password for that login.
  - **Database name** (optional) — the specific database to connect to. Leave blank to connect at the server level.
  - **Timezone** — the time zone used to interpret date values in query results. Defaults to `Etc/UTC`.
4. Click **Connect**.


connect
## Datasets

The Microsoft SQL Server integration supports the creation of [datasets](/understanding-datasets), which allow you to define and shape the specific data you want to use for reporting in Databox. Datasets make it easier to focus on the most relevant information, enabling you to filter, visualize, and analyze metrics across projects, teams, and clients without writing complex queries each time.

### Steps to create a dataset:

1. **Select a table**: Pick the appropriate schema within that database.
2. **Select columns**: Browse and select the specific columns (fields) from your tables or views to include in your dataset. These columns define the structure and content of your dataset.


### Optional: Write SQL

For more advanced use cases, you can write a **custom SQL query** instead of selecting columns manually. This allows you to:

- Join multiple tables
- Apply filters and aggregations
- Format or transform data before importing it into Databox


Your query must return a valid tabular result to be used as a dataset.

### Additional resources

- [SQL Server documentation](https://learn.microsoft.com/en-us/sql/sql-server/) — Official Microsoft documentation hub covering installation, T-SQL syntax, security, replication, and release notes for all supported versions.
- [SQL Server Configuration Manager](https://learn.microsoft.com/en-us/sql/tools/configuration-manager/sql-server-configuration-manager-help) — Reference for managing SQL Server services, network protocols, and client configuration.


## Resources

For comprehensive details on metrics, data availability, templates, specifications, usage guidelines, and other key information, refer to the resources listed below.

Yes. For a named instance (e.g., `SERVERNAME\INSTANCENAME`), enter the full instance name in the **Server name** field and ensure the **SQL Server Browser** service is running on your server. Alternatively, if you have configured the named instance to listen on a fixed port, enter that port in the **Port** field instead of the default `1433`.

Check the following in order:

1. TCP/IP is enabled in SQL Server Configuration Manager and the instance is listening on port `1433`
2. The SQL Server service was restarted after enabling TCP/IP or changing the port
3. Your firewall permits inbound TCP traffic on port `1433` from `52.4.198.118`
4. The SQL Server login exists at the server level and a corresponding user with `SELECT` permissions exists in the target database


 

Ask Genie
Get instant answers or help with your data using the in-app AI assistant.

Talk to an expert
For customers: Get help with your setup, strategy, or making the most of Databox.

Book a demo
New to Databox? See how it works and get guidance on getting started.

Send an email
Reach out to support for help with your account, data, or technical issues.