Microsoft SQL Server Connector

Connect Google Sheets to Microsoft SQL Server

About MS SQL Server

Microsoft SQL Server is a relational database management system that supports data transactions, business intelligence and analytics applications. As one of the three marketing-leading database technologies, Microsoft SQL Server offers increased security, reliability, data integrity, and high-speed data processing.

Integrate MS SQL Server

The easiest and fastest way to connect your Microsoft SQL database to Google Sheets. With Castodia, you can test the limits by analyzing stored data from relational databases, running and scheduling queries, and auto-refreshing data from a yearly basis down to a 1-minute frequency. LEARN MORE

[Update: December 2020] Users will no longer need to individually share each sheet with the Castodia service account as described in the video. Users will instead be required to authenticate with their Google Account only once and this will automatically enable auto-refresh for any sheet.

How to Connect Oracle Database to Google Sheets

Castodia lets you pull data from your Microsoft SQL database directly into Google Sheets.

To connect your Microsoft SQL database, follow the steps below:

Step 1: Install the Castodia GSuite Marketplace Database Connector

Step 2: Create a Google Sheet and click "Add-Ons" within the toolbar section to access the Castodia Database Connector

Step 3: Two options will appear when you hover over the add-on: launch and settings. Click "Settings."

Step 4: Type in a name to help identify your database

Step 5: Click the drop-down menu to access the Microsoft SQL database

Step 6: Gather and enter your database connection information. There are five components needed:

  • Database Name
  • Host
  • Port
  • Username
  • Password

Step 7: Click the "Test" button to run the database and verify your credentials

Step 8: Click the "Save" button once a green notification pops up, indicating that the add-on was successfully installed.

And that's it! Enjoy running your queries.

Use Case


Suppose an account manager is looking to gather quarterly sales overviews to present at the company board meeting. The Suppose a digital marketer is looking to present findings for a client's recent AdWords campaign. The campaign is coming close to its 6-week duration, and the client wants to assess the performance of the campaign. Considering that this is the client's first ad spend, it is critical that accurate analysis is made for future marketing decisions.

The digital marketer wants to visualize and analyze three metrics:

  1. AdWords Clicks
  2. Adwords Conversions
  3. AdWords Cost per Action (CPA)


Rather than manually exporting CSV files to derive insightful analytics, the account manager can use Castodia's Database Connector to connect their Microsoft SQL database to Google Sheets, run and save important queries, and auto-refresh their data every two weeks based on their custom schedule.

To get started, install the Castodia GSuite Add-On and access a new Google sheet. Once you have connected your Microsoft SQL database, you can begin to run SQL queries.

Castodia also gives users the freedom to create custom schedules or databases. Although the campaign has not ended yet, the digital marketer can begin creating charts and graphs with the existing data. The digital marketer can then set a schedule to auto-refresh week 6's data. This way, the data will automatically update the charts and graphs as well in one week's time.

Ad campaign

Now let's explore the three metrics:

1. AdWords Clicks

Over the 6-week period, the ad campaign generated a total of 5,595 clicks. There is a large discrepancy between weeks 4 and 5, with a decrease of 1,000 clicks. The digital marketer can look further into the reasonings for this and present it to their client.

AdWords Clicks

2. Adwords Conversions

The digital marketer can also examine the AdWord campaign conversions. A potential reason for the large spike in week 4 could be the promotion of an attractive weekly deal. Nonetheless, the digital marketer would spend time revisiting the campaign.

AdWords Conversions

3. AdWords CPA

The total cost per action totalled $38.43 over the 6-week period. Evidently, this data correlates with the week-by-week breakdown of AdWord clicks and conversion rates. Overall, this campaign proved to be effective, with some minor pitfalls to be taken into account if another AdWord campaign were to be launched in the future.

AdWords CPA


All Castodia Database Connector Features

1 minute auto-refresh

1 Minute Auto-Refresh

Set refresh frequency to every day, every few hours, or every few minutes. Down to once every 1 minute

Advanced scheduling

Advanced Scheduling

Auto refresh data daily, weekly, monthly or yearly with fully customizable schedules

Intuitive UI Castodia

Intuitive UI

Run, save and schedule queries all from within Google Sheets using a clean and intuitive interface

Long query run time

Long Query Time

Run long/complex queries that take minutes to run. Fearlessly run large queries without unexpected errors

Append vs overwrite

Append and Overwrite

Choose how to auto-refresh data on your spreadsheet. Smart Overwrite prevents calculations intact

Direct SQL query

Direct SQL Query

Paste any SQL query and run them directly from Google Sheets. If it runs on your editor it will also run here

Start free trial

Try Castodia free for 14 days, no credit card required.