View Categories

How to Run SQL Queries in Excel

SQL
SELECT name, revenue
FROM sales
WHERE region = ‘West’
Excel
MICROSOFT EXCEL SQL QUERIES

Run SQL Queries
Directly in Excel

Write SQL against any database and stream live results into your spreadsheet — no ODBC drivers, no VBA macros, no connection string headaches. Just SQL in Excel, the way it should work.

Live Results 10+ Databases No Drivers AI-Assisted SQL

Query Streams is a secure, real-time database integration platform that lets you run SQL queries in Excel against any database — without installing ODBC drivers, writing VBA macros, or configuring connection strings on every machine. Learn more at QueryStreams.com and sign up for free to start running SQL queries from your spreadsheets.

Running SQL in Excel is one of the most searched-for capabilities among data professionals, analysts, and business users who live in spreadsheets but need access to live database information. Whether you want to pull a sales report from SQL Server, query a PostgreSQL analytics warehouse, or aggregate MySQL transaction data — the goal is the same: get database results into Excel cells without manual exports, stale CSV files, or copy-paste workflows.

This guide covers three ways to run an Excel SQL query, explains why the traditional approaches create friction, and shows how Query Streams eliminates every barrier between your SQL and your spreadsheet.

3 Ways to Run SQL in Excel

There are three main approaches to running SQL queries in Excel. Each has a different setup complexity, different limitations, and different levels of ongoing maintenance. Here’s a side-by-side breakdown.

Power QueryBuilt-in

Excel’s native data connection tool. Uses ODBC or OLE DB drivers to connect to databases through the Data tab. Supports basic SQL via the “Advanced Editor” but requires driver installation on every machine.

  • Built into Excel (no add-in needed)
  • Supports SQL via Advanced Editor
  • Requires ODBC/OLE DB drivers per machine
  • 32-bit vs 64-bit driver conflicts
  • Direct TCP connection to database needed
  • No query sharing or interactive filters
VBA + ODBCManual

Write Visual Basic for Applications macros that open ADODB connections using ODBC connection strings. Gives full SQL control but requires programming skills and embeds credentials in VBA code.

  • Full SQL control and automation
  • Can build custom UIs with UserForms
  • Requires VBA programming knowledge
  • Credentials stored in macro code
  • Still needs ODBC drivers installed
  • Macros blocked by many IT security policies

Why Traditional Methods Fall Short

Both Power Query and VBA/ODBC approaches share the same foundational problem: they require a direct connection from the user’s workstation to the database server. This creates cascading issues that grow worse as your team scales.

ODBC Driver Installation and Maintenance

Every user who needs to run an SQL query in Excel must install the correct ODBC driver on their machine. If your organization uses SQL Server, PostgreSQL, and MySQL, that’s three separate drivers per workstation. Each driver has its own version cadence and compatibility requirements. The infamous 32-bit versus 64-bit driver mismatch remains one of the most common ODBC troubleshooting issues, often taking hours to diagnose.

Connection String Complexity

Whether you use Power Query’s Data Source settings or VBA’s ADODB connection objects, every user needs the server hostname, port, database name, authentication method, and often SSL/TLS parameters. This configuration is per-machine and not portable. Moving to a new laptop means rebuilding every connection from scratch. Sharing a working connection with a colleague means sending them a block of configuration text and hoping they paste it correctly.

Credential Exposure

With VBA, database credentials live inside the macro code. With Power Query, they’re stored in Windows Credential Manager on each machine. Either way, credentials are distributed across every workstation that needs database access. When an employee leaves or a laptop is lost, each of those credentials becomes a potential breach point. Microsoft’s own security best practices advise centralizing credential management — but ODBC-based workflows push in the opposite direction.

No Built-In Query Sharing

You wrote a complex SQL query that produces the perfect quarterly revenue report. Your colleague wants the same data filtered by their region. With ODBC, sharing that query means sharing the SQL code, the connection details, and the credentials — then hoping they have the right drivers installed. There is no built-in mechanism to share the capability to run a query without also sharing everything needed to access the database directly.

How Query Streams Runs SQL in Excel

Query Streams takes a fundamentally different approach. Instead of pushing database drivers and credentials to every user machine, you install a single lightweight Agent on your database server (or any machine that can reach the database). The Agent handles all database communication and streams results to users through a secure, outbound-only WebSocket connection. Here’s how it works in four steps.

1

Install the Agent

Download and install the Query Streams Agent on your database server or any machine with database access. Available for Windows, macOS, and Linux.

2

Add Your Database

Open the Agent’s local UI and add your database connection. Credentials are stored locally on the Agent — they never leave your server.

3

Write SQL or Ask Nova

Use the Query Streams web portal to write SQL queries directly, or describe what you need in plain English and let Nova AI generate the SQL for you. Save queries with optional interactive filters.

4

Run From Excel

Open the Excel add-in, select your saved query, adjust any filters, and run. Live results stream directly into your spreadsheet cells on demand.

No firewall changes needed. The Agent initiates an outbound-only WebSocket connection to the Query Streams relay over HTTPS (port 443). Your database port is never opened to the internet. IT teams can deploy the Agent without any network modifications.

SQL in Excel Features

Query Streams doesn’t just replace ODBC — it adds capabilities that Power Query and VBA were never designed for. Here’s what you get when running SQL in Excel with Query Streams.

Interactive Filters

Query Streams auto-detects parameters and static values in your SQL, turning them into dropdown menus and date pickers that end users can adjust before running.

Secure Query Sharing

Share the ability to run a query without exposing SQL code or database credentials. Recipients select from their query list, adjust filters, and get live results.

Parallel Execution

Launch multiple saved queries simultaneously — five queries into five different worksheet tabs. The Agent streams each concurrently regardless of result size.

Nova AI SQL Assistant

Describe what data you need in plain English and Nova generates the SQL query for you. Works with every supported database dialect.

On-Demand Live Data

No scheduled refreshes or stale exports. Run your SQL query in Excel any time and get live data from the database in seconds.

Google Sheets Too

The same Agent and saved queries work with the Google Sheets add-on. One platform serves both spreadsheet ecosystems.

Supported Databases for Excel SQL Queries

Query Streams supports all major relational databases and cloud data platforms. One Agent installation handles every database type — no separate driver for each.

Database Versions / Platforms Guide
Microsoft SQL Server Express, Standard, Enterprise, Azure SQL, AWS RDS SQL Server to Excel
PostgreSQL All versions, AWS RDS, Azure Database, Supabase, Neon PostgreSQL to Excel
MySQL 5.7+, Amazon RDS, Azure Database, Google Cloud SQL MySQL to Excel
MariaDB 10.x and 11.x, SkySQL, all cloud variants MariaDB to Excel
SQLite Local .db files on the Agent machine SQLite to Excel
Microsoft Access .accdb and .mdb files Access to Excel
Oracle 11g+, Oracle Cloud, Autonomous Database Oracle to Excel
Snowflake All editions across AWS, Azure, and GCP Snowflake to Excel
Google BigQuery All project types and regions BigQuery to Excel
DuckDB Local analytical databases, Parquet/CSV file queries DuckDB to Excel

Google Sheets guides are also available for every database listed. Deploy multiple Agents (based on your subscription tier) across your infrastructure — on-premise, AWS EC2, Azure VMs, Google Cloud, or any environment globally. All agents self-maintain with automatic updates and present their data sources as a unified dropdown list, so users simply select from available data sources without needing to know which agent or server hosts them.

Security: SQL Without the Risk

Credentials never leave your server. Database usernames and passwords are stored exclusively on the Agent machine. End users authenticate through the Query Streams portal and interact only with saved queries — they never see connection strings, SQL code, or database credentials. The Agent connects outbound over HTTPS (port 443), so no inbound firewall ports are opened and your database is never exposed to the internet. Shared query recipients can independently run queries and adjust filters without any action from the query creator.

This architecture is the opposite of the ODBC model, where every client machine stores credentials locally. With Query Streams, revoking access means removing a user from the portal — not tracking down DSN entries across dozens of laptops. For a deeper comparison, see our ODBC Alternative for Excel guide.

Frequently Asked Questions

Can I run SQL directly in Excel? +
Yes. With Query Streams, you write SQL in the web portal (or let Nova AI generate it), save the query, and run it from the Excel add-in. Results stream directly into your spreadsheet cells. You don’t need to open a command line, install database management software, or write VBA macros. The Excel add-in gives you a point-and-click interface to select queries, adjust filters, and execute — all within Excel.
Do I need ODBC drivers to run SQL queries in Excel? +
Not with Query Streams. Traditional methods like Power Query and VBA require ODBC or OLE DB drivers installed on every user’s machine. Query Streams eliminates this entirely — the Agent handles all database communication server-side. Users only need the Excel add-in, which requires no local driver installation.
What databases work with SQL in Excel through Query Streams? +
Query Streams supports Microsoft SQL Server, PostgreSQL, MySQL, MariaDB, SQLite, Microsoft Access, Oracle, Snowflake, Google BigQuery, and DuckDB. This covers on-premise installations, cloud-hosted databases on AWS RDS, Azure SQL, Google Cloud SQL, and specialized platforms like Supabase, Neon, and PlanetScale. One Agent handles all database types.
Can I share SQL queries with other Excel users? +
Yes — this is one of Query Streams’ strongest features. You can share saved queries with any user in your organization. Shared recipients see the query in their Excel add-in, can adjust any available interactive filters (dropdowns, date pickers), and run it to get live data on demand. They never see the underlying SQL code or database credentials. No action is needed from the query creator after sharing.
Does this work with Excel Online? +
Yes. The Query Streams Excel add-in is compatible with Excel for desktop (Windows and macOS) as well as Excel Online (Office 365 web). Since Query Streams doesn’t rely on local ODBC drivers, the web version works identically — you select a query, adjust filters, and run it from the browser.
Can Nova AI write SQL for me? +
Yes. Nova is Query Streams’ built-in AI assistant that generates SQL queries from plain English descriptions. Describe what data you need — for example, “show me total revenue by product category for the last quarter” — and Nova writes the SQL, matched to your specific database schema and dialect. You can review, edit, and save the generated query, then run it from Excel or Google Sheets.
How large can result sets be? +
Query Streams uses efficient binary streaming over WebSocket, so result sets can be substantial. For typical business reporting queries returning thousands to tens of thousands of rows, results arrive in seconds. Excel’s own row limit (1,048,576 rows) is the practical ceiling. Query Streams also supports parallel query execution — you can launch multiple queries into different worksheet tabs simultaneously, and the Agent streams each concurrently.
Is Query Streams free to try? +
Yes. You can sign up for free, install the Agent, and start running SQL queries from Excel immediately. Free accounts include access to the Excel add-in, Google Sheets add-on, saved queries, interactive filters, and Nova AI credits to get started.

Get Started

Run Your First SQL Query in Excel Today

Sign up free, install the Agent on your database server, and run live SQL queries from Excel in under 10 minutes. No drivers. No VBA. No connection strings.

Related guides: SQL Server to Excel | PostgreSQL to Excel | ODBC Alternative for Excel | Databases in Microsoft Excel

Category: Articles

Tags: sql-in-excel, excel-sql-query, database-excel, odbc-alternative, power-query, live-data, no-code, query-sharing

Meta Description: Run SQL queries in Excel without ODBC drivers or VBA. Stream live database results into spreadsheets.

Updated on June 3, 2026

Powered by BetterDocs