Skip to main content

Overview

The SQL Server integration enables your agents to execute T-SQL queries against Microsoft SQL Server and Azure SQL Database. Ideal for querying operational data, generating reports, and analyzing business metrics stored in SQL Server.

Features

  • Full T-SQL Support: Execute any T-SQL query including SELECT, INSERT, UPDATE, DELETE, and DDL operations
  • Azure SQL Compatible: Works with both on-premises SQL Server and Azure SQL Database
  • Structured Results: Returns data with column headers and type information
  • CSV Export: Automatically generates downloadable CSV files for large result sets
  • Smart Truncation: Token-based result truncation to manage response sizes while preserving full CSV output

Prerequisites

  • SQL Server instance or Azure SQL Database accessible over the network
  • Database user credentials with appropriate permissions
  • Network connectivity from Vercel to your SQL Server (may require firewall rules)

Setup Guide

1

Prepare Database Access

Create a dedicated database user for agent access. For read-only use cases:
CREATE LOGIN aster_agent WITH PASSWORD = 'your_password';
CREATE USER aster_agent FOR LOGIN aster_agent;
GRANT SELECT ON SCHEMA::dbo TO aster_agent;
2

Configure Network Access

Ensure your SQL Server is accessible from external connections:
  • Azure SQL: Add Vercel’s IP ranges to your firewall rules, or enable “Allow Azure services”
  • On-premises: Configure your firewall to allow inbound connections on port 1433
3

Enable SQL Server Integration

In Aster Agents, navigate to Control Hub > Integrations and locate the SQL Server card. Click Connect and provide:
  • Server Host — hostname or IP (e.g., myserver.database.windows.net for Azure)
  • Port — default is 1433
  • Database Name — the database to connect to
  • Username — database user credentials
  • Password — database user password
  • Encrypt Connection — enable for Azure SQL (required) and recommended for all connections
4

Add Tool to Your Agent

Edit your agent and enable the SQL Server tool. The agent will be able to execute T-SQL queries against your configured database.

Security Considerations

  • Use a dedicated read-only account unless write access is specifically needed
  • Apply least-privilege permissions — grant access only to the schemas and tables the agent needs
  • Enable TLS encryption for all connections (required for Azure SQL)
  • Use Azure AD authentication where possible for Azure SQL Database
  • Monitor query activity in SQL Server Audit or Azure SQL auditing
  • Set connection and request timeouts — the integration uses 15-second connection and 30-second request timeouts by default

Troubleshooting

  • Verify the server hostname and port are correct
  • Check firewall rules — your SQL Server must accept connections from Vercel’s IP ranges
  • For Azure SQL, ensure “Allow Azure services and resources to access this server” is enabled if needed
  • Confirm the SQL Server instance is running and accepting TCP/IP connections
  • Verify username and password are correct
  • For Azure SQL, use the full username format: username@servername
  • Check that SQL Server authentication mode is enabled (not just Windows Authentication)
  • Confirm the user account is not locked or disabled
  • Azure SQL requires encryption — set Encrypt Connection to “Enabled”
  • For on-premises servers without a trusted certificate, you may need to disable encryption (not recommended for production)
  • If using a self-signed certificate, the integration will trust it when encryption is disabled
  • The default request timeout is 30 seconds — optimize long-running queries with indexes or filtering
  • Break large queries into smaller, more targeted queries
  • Use TOP or pagination to limit result set sizes