Connect to Microsoft SQL Server
Connect Microsoft SQL Server to Retool to query data, manage records, and build apps and automations with T-SQL.
Microsoft SQL Server is a relational database management system. You can create a Microsoft SQL Server resource to securely connect to your databases and create apps and automations that use T-SQL queries to perform create, read, update, and delete operations.
What you can do with Microsoft SQL Server in Retool
- Query with T-SQL: Write T-SQL queries with joins, aggregations, subqueries, common table expressions (CTEs), and window functions using SQL mode for reading data.
- Manage data: Insert, update, and delete records using GUI mode for write operations.
- Execute transactions: Perform multi-statement transactions with automatic rollback on errors.
- Call stored procedures: Execute SQL Server stored procedures with parameters and return values.
- Connect to Azure: Query Azure SQL Database, Azure SQL Managed Instance, and other Azure-hosted SQL Server instances.
Before you begin
To connect Microsoft SQL Server to Retool, you need the following:
- Cloud instances
- Self-hosted instances
- SQL Server instance: An accessible Microsoft SQL Server instance (SQL Server 2008 or later recommended).
- Network access: Your SQL Server must accept connections from Retool's IP addresses.
- Database credentials: A SQL Server login with appropriate permissions for the databases your apps will query.
- Retool permissions: Own permissions for resources in your organization.
- SQL Server instance: An accessible Microsoft SQL Server instance (SQL Server 2008 or later recommended).
- Network access: Your Retool instance must be able to reach your SQL Server.
- Database credentials: A SQL Server login with appropriate permissions for the databases your apps will query.
- SSH tunnel (optional): If your database is not publicly accessible, configure an SSH tunnel.
- Retool permissions: Own permissions for resources in your organization.
Create a Microsoft SQL Server resource
Follow these steps to create a Microsoft SQL Server resource in your Retool organization.
1. Create a new resource
In your Retool organization, navigate to Resources in the main navigation and click Create new → Resource. Search for Microsoft SQL Server and click the Microsoft SQL Server tile to begin configuration.
Use folders to organize your resources by team, environment, or data source type. This helps keep your resource list manageable as your organization grows.
2. Configure general settings
Specify a name and description for the resource that indicates which database it connects to. The description provides more context to users and Assist about how to use the resource.
| Example name | Example description |
|---|---|
SQL Server (readonly) | A read-only SQL Server database with customer and order information. |
SQL Server Prod | Production Microsoft SQL Server instance. Use for incident tracking and operational data. |
Connector version
Microsoft SQL Server resources use a connector version that determines the underlying driver behavior. Retool recommends using the latest connector version (3.0) for all new resources.
Beginning in the 2026 Q3 stable release, connector versions 1.0 and 2.0 will be deprecated. Update your resource configuration to version 3.0 before then to prevent interruptions.
| Version | Notes |
|---|---|
| 3.0 | Latest version. Includes various fixes and improvements. Recommended for all new and existing resources. |
| 2.0 | Deprecated. Removed support for array values with STRING_SPLIT. Use .join(',') to convert arrays to strings before passing to STRING_SPLIT. |
| 1.0 | Deprecated. Do not use unless instructed by Retool. |
3. Configure resource credentials
Configure the connection settings for your Microsoft SQL Server resource.
You can autofill the configuration fields using a Microsoft SQL Server connection string or by importing an existing AWS resource for RDS SQL Server instances.
Server=myserver.database.windows.net,1433;Database=mydb;User Id=myuser;Password=mypassword;