Microsoft SQL Server is Microsoft's relational database system, used for transactional and analytical workloads on-premises, on Azure SQL, and on other managed hosts. It stores structured data in tables and is queried with T-SQL.
With the Microsoft SQL Server integration in Sim, you can:
- Query data: Run SELECT statements and get back rows with a row count
- Insert, update, and delete rows: Write key-value data to a table, or modify and remove existing rows with a WHERE clause
- Execute raw T-SQL: Run arbitrary statements, including DDL such as creating or altering tables
- Introspect schemas: Retrieve table structures, columns, primary and foreign keys, and indexes
In Sim, the Microsoft SQL Server integration allows your agents to read from and write to a SQL Server database as part of a workflow — pulling records to feed downstream logic, writing agent output back to a table, and inspecting the schema before generating a query. Connections take a host, port, database, credentials, and TLS settings, so the same block works against a self-hosted instance or a managed one.
Integrate Microsoft SQL Server into the workflow. Can query, insert, update, delete, execute raw T-SQL, and introspect schemas.
Execute a SELECT query on a Microsoft SQL Server database
| Parameter | Type | Required | Description |
|---|
host | string | Yes | Microsoft SQL Server hostname or IP address |
port | number | No | Server port (default: 1433). A named instance must be reached through its static TCP port |
database | string | Yes | Database name to connect to |
username | string | Yes | Database username |
password | string | Yes | Database password |
encrypt | string | No | Request TLS encryption for the connection (enabled, disabled). Defaults to enabled. Disabling sends the login packet and every row in cleartext. Enabling requests encryption over TDS 7.4, which the server negotiates during prelogin - a server that answers NOT_SUP yields an unencrypted session rather than an error, so this is a request, not a guarantee |
trustServerCertificate | string | No | Trust a self-signed server certificate (enabled, disabled). Defaults to disabled. Enabling skips certificate validation, so the connection is open to a machine-in-the-middle |
connectionTimeout | number | No | Connection and request timeout in milliseconds (default: 15000) |
query | string | Yes | T-SQL SELECT query to execute, optionally led by a WITH clause. Statements that modify data or schema are rejected — use the Execute Raw SQL operation for those. |
| Parameter | Type | Description |
|---|
message | string | Operation status message |
rows | array | Array of rows returned from the query |
rowCount | number | Number of rows returned |
truncated | boolean | Present and true only when rows were dropped to stay inside the response ceilings. Absent means the recordset is complete |
truncationReason | string | Which ceiling was hit and how to read the remaining rows |
Insert data into a Microsoft SQL Server table
| Parameter | Type | Required | Description |
|---|
host | string | Yes | Microsoft SQL Server hostname or IP address |
port | number | No | Server port (default: 1433). A named instance must be reached through its static TCP port |
database | string | Yes | Database name to connect to |
username | string | Yes | Database username |
password | string | Yes | Database password |
encrypt | string | No | Request TLS encryption for the connection (enabled, disabled). Defaults to enabled. Disabling sends the login packet and every row in cleartext. Enabling requests encryption over TDS 7.4, which the server negotiates during prelogin - a server that answers NOT_SUP yields an unencrypted session rather than an error, so this is a request, not a guarantee |
trustServerCertificate | string | No | Trust a self-signed server certificate (enabled, disabled). Defaults to disabled. Enabling skips certificate validation, so the connection is open to a machine-in-the-middle |
connectionTimeout | number | No | Connection and request timeout in milliseconds (default: 15000) |
table | string | Yes | Table name to insert data into |
data | object | Yes | Data object to insert (key-value pairs) |
| Parameter | Type | Description |
|---|
message | string | Operation status message |
rows | array | Rows returned by the statement (empty for a plain INSERT) |
rowCount | number | Number of rows inserted |
truncated | boolean | Present and true only when rows were dropped to stay inside the response ceilings. Absent means the recordset is complete |
truncationReason | string | Which ceiling was hit and how to read the remaining rows |
Update rows in a Microsoft SQL Server table
| Parameter | Type | Required | Description |
|---|
host | string | Yes | Microsoft SQL Server hostname or IP address |
port | number | No | Server port (default: 1433). A named instance must be reached through its static TCP port |
database | string | Yes | Database name to connect to |
username | string | Yes | Database username |
password | string | Yes | Database password |
encrypt | string | No | Request TLS encryption for the connection (enabled, disabled). Defaults to enabled. Disabling sends the login packet and every row in cleartext. Enabling requests encryption over TDS 7.4, which the server negotiates during prelogin - a server that answers NOT_SUP yields an unencrypted session rather than an error, so this is a request, not a guarantee |
trustServerCertificate | string | No | Trust a self-signed server certificate (enabled, disabled). Defaults to disabled. Enabling skips certificate validation, so the connection is open to a machine-in-the-middle |
connectionTimeout | number | No | Connection and request timeout in milliseconds (default: 15000) |
table | string | Yes | Table name to update |
data | object | Yes | Data object with the columns to set (key-value pairs) |
where | string | Yes | WHERE condition identifying the rows to update |
| Parameter | Type | Description |
|---|
message | string | Operation status message |
rows | array | Rows returned by the statement (empty for a plain UPDATE) |
rowCount | number | Number of rows updated |
truncated | boolean | Present and true only when rows were dropped to stay inside the response ceilings. Absent means the recordset is complete |
truncationReason | string | Which ceiling was hit and how to read the remaining rows |
Delete rows from a Microsoft SQL Server table
| Parameter | Type | Required | Description |
|---|
host | string | Yes | Microsoft SQL Server hostname or IP address |
port | number | No | Server port (default: 1433). A named instance must be reached through its static TCP port |
database | string | Yes | Database name to connect to |
username | string | Yes | Database username |
password | string | Yes | Database password |
encrypt | string | No | Request TLS encryption for the connection (enabled, disabled). Defaults to enabled. Disabling sends the login packet and every row in cleartext. Enabling requests encryption over TDS 7.4, which the server negotiates during prelogin - a server that answers NOT_SUP yields an unencrypted session rather than an error, so this is a request, not a guarantee |
trustServerCertificate | string | No | Trust a self-signed server certificate (enabled, disabled). Defaults to disabled. Enabling skips certificate validation, so the connection is open to a machine-in-the-middle |
connectionTimeout | number | No | Connection and request timeout in milliseconds (default: 15000) |
table | string | Yes | Table name to delete rows from |
where | string | Yes | WHERE condition identifying the rows to delete |
| Parameter | Type | Description |
|---|
message | string | Operation status message |
rows | array | Rows returned by the statement (empty for a plain DELETE) |
rowCount | number | Number of rows deleted |
truncated | boolean | Present and true only when rows were dropped to stay inside the response ceilings. Absent means the recordset is complete |
truncationReason | string | Which ceiling was hit and how to read the remaining rows |
Execute a raw T-SQL statement on a Microsoft SQL Server database
| Parameter | Type | Required | Description |
|---|
host | string | Yes | Microsoft SQL Server hostname or IP address |
port | number | No | Server port (default: 1433). A named instance must be reached through its static TCP port |
database | string | Yes | Database name to connect to |
username | string | Yes | Database username |
password | string | Yes | Database password |
encrypt | string | No | Request TLS encryption for the connection (enabled, disabled). Defaults to enabled. Disabling sends the login packet and every row in cleartext. Enabling requests encryption over TDS 7.4, which the server negotiates during prelogin - a server that answers NOT_SUP yields an unencrypted session rather than an error, so this is a request, not a guarantee |
trustServerCertificate | string | No | Trust a self-signed server certificate (enabled, disabled). Defaults to disabled. Enabling skips certificate validation, so the connection is open to a machine-in-the-middle |
connectionTimeout | number | No | Connection and request timeout in milliseconds (default: 15000) |
query | string | Yes | T-SQL statement to execute |
| Parameter | Type | Description |
|---|
message | string | Operation status message |
rows | array | Rows returned by the statement, when it returns a result set |
rowCount | number | Number of rows returned or affected |
truncated | boolean | Present and true only when rows were dropped to stay inside the response ceilings. Absent means the recordset is complete |
truncationReason | string | Which ceiling was hit and how to read the remaining rows |
Introspect a Microsoft SQL Server schema to retrieve table structures, columns, keys, and indexes. Results only cover objects the login can see, so a low-privilege account returns a partial schema rather than an error
| Parameter | Type | Required | Description |
|---|
host | string | Yes | Microsoft SQL Server hostname or IP address |
port | number | No | Server port (default: 1433). A named instance must be reached through its static TCP port |
database | string | Yes | Database name to connect to |
username | string | Yes | Database username |
password | string | Yes | Database password |
encrypt | string | No | Request TLS encryption for the connection (enabled, disabled). Defaults to enabled. Disabling sends the login packet and every row in cleartext. Enabling requests encryption over TDS 7.4, which the server negotiates during prelogin - a server that answers NOT_SUP yields an unencrypted session rather than an error, so this is a request, not a guarantee |
trustServerCertificate | string | No | Trust a self-signed server certificate (enabled, disabled). Defaults to disabled. Enabling skips certificate validation, so the connection is open to a machine-in-the-middle |
connectionTimeout | number | No | Connection and request timeout in milliseconds (default: 15000) |
schema | string | No | Schema to introspect (default: dbo) |
| Parameter | Type | Description |
|---|
message | string | Operation status message |
tables | array | Array of table schemas with columns, keys, and indexes |
↳ name | string | Table name |
↳ schema | string | Schema name (e.g., dbo) |
↳ columns | array | Table columns in ordinal position order |
↳ name | string | Column name |
↳ type | string | Data type (e.g., int, nvarchar, datetime2) |
↳ nullable | boolean | Whether the column allows NULL values |
↳ default | string | Default value expression |
↳ isPrimaryKey | boolean | Whether the column is part of the primary key |
↳ isForeignKey | boolean | Whether the column is a foreign key |
↳ references | object | Foreign key reference information |
↳ schema | string | Referenced schema name |
↳ table | string | Referenced table name |
↳ column | string | Referenced column name |
↳ primaryKey | array | Primary key column names, in key order |
↳ foreignKeys | array | Foreign key constraints declared on this table |
↳ column | string | Local column name |
↳ referencesSchema | string | Referenced schema name |
↳ referencesTable | string | Referenced table name |
↳ referencesColumn | string | Referenced column name |
↳ indexes | array | Non-primary-key rowstore indexes on this table |
↳ name | string | Index name |
↳ columns | array | Key columns included in the index, in key order |
↳ unique | boolean | Whether the index enforces uniqueness |
schemas | array | List of available schemas in the database |