# Integrate Google Cloud for SQL Server with Databox

Google Cloud SQL is a fully managed relational database service from Google Cloud that handles provisioning, maintenance, and scaling of SQL Server databases without requiring you to manage the underlying infrastructure. It supports SQL Server 2017, 2019, and 2022 and is commonly used to power web applications, internal tools, and analytics pipelines hosted on Google Cloud. Connecting Google Cloud for SQL Server to Databox lets you pull data directly from your managed database, build datasets using SQL queries, and visualize business-critical figures alongside data from your other connected tools.

## 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 on the database you want to connect. You can run these commands using the **Cloud SQL Studio** query editor in the Google Cloud Console, or via a SQL Server client (such as SSMS or Azure Data Studio) connected to your instance.


```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 password, as they can cause encoding issues when establishing the connection: ```, `'`, `"`, `/`, `\`, and spaces.

### Step 2: Enable a public IP address on your Cloud SQL instance

Databox connects to Cloud SQL over a public IP address. If your instance does not already have one assigned, enable it in the Google Cloud Console.

1. In the [Google Cloud Console](https://console.cloud.google.com/sql), go to **SQL** and select your instance.
2. Click **Edit**.
3. Under **Connections**, expand **Networking** and ensure **Public IP** is enabled.
4. Click **Save** to apply the change.


Your instance's public IP address is shown on the **Overview** tab of the Cloud SQL instance page, under **Connect to this instance**. Copy this value — you will need it in [Step 4](#step-4-enter-your-cloud-sql-connection-details-in-databox).

### Step 3: Add the Databox IP to your authorized networks

Cloud SQL controls inbound network access through an authorized networks list. Add the Databox IP address as an authorized network so it can reach your instance on port `1433`.

1. In the [Google Cloud Console](https://console.cloud.google.com/sql), go to **SQL** and select your instance.
2. Click **Edit**.
3. Under **Connections > Networking > Authorized networks**, click **Add a network**.
4. In the **Network** field, enter `52.4.198.118/32`.
5. Optionally enter a name (e.g., `Databox`) in the **Name** field.
6. Click **Done**, then click **Save**.


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

1. In Databox, go to **Data Sources > + New connection**.
2. Search for **Google Cloud for SQL Server** and click **Connect**.
3. Fill in the connection form:
  - **Data source name** — a label for this connection in Databox.
  - **Server Name** — the public IP address of your Cloud SQL instance, found on the instance's **Overview** tab in the Google Cloud Console (e.g., `34.123.45.67`).
  - **Port** — the port your Cloud SQL instance listens on. The default for SQL Server 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 Google Cloud SQL for 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

- [Cloud SQL for SQL Server documentation](https://cloud.google.com/sql/docs/sqlserver) — Official Google Cloud docs for Cloud SQL for SQL Server, covering instance creation, connectivity, user management, security, backups, high availability, and replication.
- [Cloud SQL connection options](https://cloud.google.com/sql/docs/sqlserver/connect-overview) — Overview of all available connection methods for Cloud SQL, including public IP, private IP, and the Cloud SQL Auth Proxy, with guidance on when to use each.


## Resources

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

No. Databox connects to Cloud SQL over a public IP address only. The Cloud SQL Auth Proxy and private IP connectivity are not supported. Your instance must have a public IP address enabled and the Databox IP (`52.4.198.118`) must be listed in the instance's authorized networks.

Check the following in order:

1. **Public IP** is enabled on the instance (under **Edit > Connections > Networking**).
2. The **Authorized networks** list includes `52.4.198.118/32`.
3. The SQL Server login was created at the server level and a corresponding user exists in the target database with `SELECT` permissions.


 

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.