How to Connect SQL Server to Tableau in PostgreSQL

Galaxy Glossary

How do you connect Microsoft SQL Server to Tableau for live dashboards?

Establishes a reliable bridge between Microsoft SQL Server and Tableau for live analytics or extracts.

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

What prerequisites must be in place?

Install the latest Microsoft ODBC Driver 18 (or higher), ensure the SQL Server port (1433) is open, and verify the user has SELECT rights on the target database.

How do I create a SQL Server data source in Tableau Desktop?

Open Tableau Desktop → Connect pane → Microsoft SQL Server. In the dialog, provide Server, optional Port, an authentication method, and the target Database. Click Sign In.

Step 1 – Choose Live vs Extract

Select Live for real-time dashboards; select Extract when performance or offline access matters. Extracts cache query results and reduce load on SQL Server.

Step 2 – Use Custom SQL for complex joins

Click New Custom SQL. Paste your query that joins Customers, Orders, and OrderItems. Tableau treats the result as a virtual table you can visualize instantly.

How can parameters improve performance?

Create a Tableau parameter (e.g., Select Year) and bind it in Custom SQL with a WHERE clause. Tableau only queries rows that match the chosen year, cutting scan time.

What best practices keep dashboards fast?

Index frequently filtered columns (Orders.order_date, Customers.id). Avoid SELECT *. Return only needed fields. Aggregate at the lowest useful grain before data reaches Tableau.

How do I publish a secure data source?

After building the workbook, choose Server → Publish Data Source. Enable Embedded Credentials or Prompt User depending on security policy. Test connection on Tableau Server.

Why How to Connect SQL Server to Tableau in PostgreSQL is important

How to Connect SQL Server to Tableau in PostgreSQL Example Usage


-- Add as Custom SQL in Tableau
SELECT
  COUNT(*) AS repeat_buyers
FROM Customers c
WHERE EXISTS (
  SELECT 1 FROM Orders o
  WHERE o.customer_id = c.id
  AND   o.order_date >= date_trunc('year', CURRENT_TIMESTAMP)
)

How to Connect SQL Server to Tableau in PostgreSQL Syntax


ODBC Connection String (Tableau → SQL Server):
DRIVER={ODBC Driver 18 for SQL Server};
SERVER=sql-prod.company.com,1433; -- optional port
DATABASE=ecommerce;
UID=analytics_ro;PWD=•••••••; -- or Trusted_Connection=yes
Encrypt=yes;TrustServerCertificate=no;

Custom SQL example for Tableau:
SELECT
  o.id              AS order_id,
  c.name            AS customer_name,
  o.order_date,
  p.name            AS product_name,
  oi.quantity,
  (oi.quantity * p.price) AS line_total
FROM Orders o
JOIN Customers  c ON c.id  = o.customer_id
JOIN OrderItems oi ON oi.order_id = o.id
JOIN Products   p ON p.id  = oi.product_id
WHERE o.order_date >= '2024-01-01';

Common Mistakes

Frequently Asked Questions (FAQs)

Can Tableau connect to SQL Server on Azure?

Yes. Use the same connector; provide the fully-qualified Azure SQL hostname and enable Encrypt=yes.

Does Tableau support Windows authentication?

Absolutely. Choose Use Windows Authentication in the sign-in dialog. Tableau passes your Kerberos ticket to SQL Server.

How do I refresh extracts automatically?

Publish the workbook to Tableau Server or Tableau Cloud and schedule an Extract Refresh. Ensure the server’s Run As account can reach SQL Server.

Want to learn about other SQL terms?

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