How to Connect SQL Server to Looker

Galaxy Glossary

How do I connect Microsoft SQL Server to Looker?

Securely configure Looker to query data stored in Microsoft SQL Server.

Sign up for the latest in SQL knowledge from the Galaxy Team!
Welcome to the Galaxy, Guardian!
Oops! Something went wrong while submitting the form.

Description

Table of Contents

Why connect SQL Server to Looker?

Looker can only visualize data held in a database it can reach. Adding SQL Server lets analysts create dashboards without copying data.

What prerequisites must be met?

Confirm you have (a) a SQL Server hostname or IP, (b) a SQL login with read rights, (c) the port open (default 1433) to the Looker IP(s), and (d) SSL certificates if required.

How do I add the connection in Looker?

Navigate to Admin → Connections → New Connection. Choose “Microsoft SQL Server.” Supply the values below, save, and test.

Required parameters

Name: lowercase, no spaces (ex: sqlserver_ecommerce)
Host: db.company.com
Port: 1433
Database: ecommerce
Username/Password: service account

Optional parameters

SSL: enable to encrypt traffic.
PDT Support: allow Looker to create Persistent Derived Tables.

How do I verify the connection?

Open SQL Runner, pick the new connection, and run a simple query such as:

SELECT TOP 5 id, name, email FROM Customers ORDER BY created_at DESC;

Best practices for production

Grant the Looker user read-only access to base schemas and db_ddladmin or a dedicated schema for PDTs only when needed. Monitor query cost with SQL Server DMVs.

How to troubleshoot failed tests?

“Could not connect” → verify firewall and SSL settings.
“Login failed” → confirm SQL authentication (not Windows) and password.
“Database unavailable” → check the chosen default database exists.

Can I limit Looker to specific tables?

Create a user-mapped role and grant SELECT only on needed tables, e.g. GRANT SELECT ON dbo.Orders TO looker_ro;

Why How to Connect SQL Server to Looker is important

How to Connect SQL Server to Looker Example Usage


-- Check last 10 high-value orders in Looker SQL Runner
SELECT TOP 10 o.id,
       c.name AS customer_name,
       o.order_date,
       o.total_amount
FROM   Orders      o
JOIN   Customers   c ON c.id = o.customer_id
WHERE  o.total_amount > 500
ORDER BY o.order_date DESC;

How to Connect SQL Server to Looker Syntax


-- Looker connection settings (YAML-like for clarity)
connection_name: sqlserver_ecommerce
host: db.company.com
port: 1433
database: ecommerce
username: looker_ro
password: ********
ssl: required|optional
pdt_storage_database: looker_temp

-- Permission script run in SQL Server
CREATE LOGIN looker_ro WITH PASSWORD = 'StrongPass!2024';
CREATE USER looker_ro FOR LOGIN looker_ro;
EXEC sp_addrolemember 'db_datareader', 'looker_ro';  -- read all tables
GRANT SELECT ON dbo.Customers  TO looker_ro;          -- fine-grained example
GRANT SELECT ON dbo.Orders     TO looker_ro;

Common Mistakes

Frequently Asked Questions (FAQs)

Do I need to install a driver?

No. Looker’s hosted platform already bundles the Microsoft JDBC driver. For customer-hosted Looker (Looker on prem), install mssql-jdbc-<ver>.jar in the drivers folder.

Can Looker write back to SQL Server?

Only via Persistent Derived Tables (PDTs). Enable PDT Support and grant CREATE TABLE on the target schema.

Does Looker support Azure SQL Database?

Yes. Use the same connector. Whitelist Looker IP ranges in the Azure firewall and ensure encrypt=true.

Want to learn about other SQL terms?

Trusted by top engineers on high-velocity teams
Aryeo Logo
Assort Health
Curri
Rubie Logo
Bauhealth Logo
Truvideo Logo
Welcome to the Galaxy, Guardian!
Oops! Something went wrong while submitting the form.