Microsoft SQL Server Component
Query and manage data in a Microsoft SQL Server (MSSQL) database.
Component key: ms-sql-server · · Changelog ↓Description
Microsoft SQL Server (MSSQL) is a popular relational database system. This component allows querying an MSSQL database.
API Documentation
This component was built using the Microsoft SQL Server documentation.
Instead of generating dynamic queries and sanitizing SQL manually, generic queries with named parameter placeholders like @variableKey can be used.
For example, a query that reads INSERT INTO users (name, email) VALUES (@name, @email) may be entered.
Then, values with keys of name and email can be entered, along with any desired values.
Values provided for name and email are sanitized automatically.
If SQL queries are being dynamically generated and the required parameters are not known ahead of time, create a key/value object in another step and reference it through the Parameters Object input.
In the example above, an object of the form {name: "John doe", email: "john.doe@example.com"} could be generated.
Connections
Azure Active Directory
key: azureAdUse the Azure Active Directory connection to connect to Azure SQL Database, Microsoft Fabric, or any SQL Server instance that supports Azure Active Directory authentication via service principal credentials.
Prerequisites
- An Azure AD App Registration with a client secret
- The service principal must have the appropriate permissions on the target database or Fabric workspace
Configure the Connection
- Host: The server address (e.g.,
my-server.database.windows.netfor Azure SQL, ormy-server.datawarehouse.fabric.microsoft.comfor Fabric) - Port: The database port (default:
1433) - Database: The name of the database or Fabric warehouse
- Tenant ID: The Directory (Tenant) ID from the Azure AD App Registration
- Client ID: The Application (Client) ID from the Azure AD App Registration
- Client Secret: The client secret from the Azure AD App Registration
- Connection Timeout: Milliseconds before the connection attempt is considered failed (default:
15000)
Token acquisition and refresh are handled automatically by the underlying driver.
On-prem enabled: this connection can be configured to connect to an on-prem resource on a private network. Learn more.
| Input | Notes | Example |
|---|---|---|
| Client ID | The Application (Client) ID from the Azure AD App Registration. | xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
| Client Secret | The Client Secret from the Azure AD App Registration. | |
| Connection Timeout | The number of milliseconds before the attempt to connect is considered failed. | 15000 |
| Database | The name of the database or Fabric warehouse. | my-fabric-warehouse |
| Host | The address of the SQL Server or Fabric warehouse endpoint. | my-server.database.windows.net |
| Port | The port the database server is exposing. | 1433 |
| Tenant ID | The Directory (Tenant) ID from the Azure AD App Registration. | xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
Basic Authentication
key: basicUse the Basic Authentication connection to connect to a Microsoft SQL Server instance using a username and password.
Configure the Connection
- Host: The address of the database server (e.g.,
192.168.0.1) - Port: The port the database server is exposing (default:
1433) - Database: The name of the database (e.g.,
msdb) - Connection Timeout: The number of milliseconds before the attempt to connect is considered failed (default:
15000) - Username: The SQL Server login username for authentication
- Password: The SQL Server login password for authentication
On-prem enabled: this connection can be configured to connect to an on-prem resource on a private network. Learn more.
| Input | Notes | Example |
|---|---|---|
| Connection Timeout | The number of milliseconds before the attempt to connect is considered failed. | 15000 |
| Database | The name of the database. | msdb |
| Host | The address of the database server. | 192.168.0.1 |
| Password | The SQL Server login password for authentication. | |
| Port | The port the database server is exposing. | 1433 |
| Username | The SQL Server login username for authentication. |
Actions
Execute Stored Procedure
Execute a stored procedure on a Microsoft SQL Server database. | key: execute
| Input | Notes | Example |
|---|---|---|
| Connection | The Microsoft SQL Server connection to use. | |
| Stored Procedure | The name of the stored procedure to execute. | myStoreProcedure |
| Timeout | The number of milliseconds to wait for a response from the server. If the timeout expires before the server responds, an error will be thrown. | 60000 |
{
"data": {
"recordsets": [
[
{
"id": 1,
"status": "active",
"last_updated": "2024-10-01T08:00:00.000Z"
}
]
],
"recordset": [
{
"id": 1,
"status": "active",
"last_updated": "2024-10-01T08:00:00.000Z"
}
],
"output": {},
"rowsAffected": [
1
],
"returnValue": 0
}
}
Query
Execute a SQL query against a Microsoft SQL Server database. | key: query
| Input | Notes | Example |
|---|---|---|
| Parameters | The key-value pairs to bind as named parameters in the query, referenced using the '@variable' operator. | |
| Parameters Object | The JSON key-value object of named parameters to bind in the query. Values are merged with the Parameters input. | |
| Query | The SQL query to execute against the Microsoft SQL Server database. Supports optional named parameters using the '@variable' operator. | |
| Connection | The Microsoft SQL Server connection to use. | |
| Timeout | The number of milliseconds to wait for a response from the server. If the timeout expires before the server responds, an error will be thrown. | 60000 |
{
"data": {
"recordsets": [
[
{
"id": 1,
"first_name": "Alice",
"last_name": "Johnson",
"email": "alice.johnson@example.com",
"created_at": "2024-08-15T10:30:00.000Z"
},
{
"id": 2,
"first_name": "Bob",
"last_name": "Martinez",
"email": "bob.martinez@example.com",
"created_at": "2024-09-22T14:45:00.000Z"
}
]
],
"recordset": [
{
"id": 1,
"first_name": "Alice",
"last_name": "Johnson",
"email": "alice.johnson@example.com",
"created_at": "2024-08-15T10:30:00.000Z"
},
{
"id": 2,
"first_name": "Bob",
"last_name": "Martinez",
"email": "bob.martinez@example.com",
"created_at": "2024-09-22T14:45:00.000Z"
}
],
"output": {},
"rowsAffected": [
2
]
}
}
Changelog
2026-04-21
Added Azure Active Directory authentication connection for Microsoft Fabric and Azure SQL Database support
2026-04-13
Various modernizations and documentation updates