Skip to content

Integrations

Microsoft SQL Server

Connect to Microsoft SQL Server database

Use Microsoft SQL Server to query or modify rows, execute T-SQL, and inspect tables, keys, and indexes.

Connection setup

In Integrations, add a connection with the host, port, database, username, password, and transport-security settings. Sim proves the connection with SELECT 1 before saving it encrypted, then reads it on the server for each run; the block, the workflow, and agents never see the password. Reconnect the connection from Integrations when its credentials change. The runtime must be able to reach the database host.

  • Encrypt connection requests TLS; leave it enabled. A server that does not support encryption gets an unencrypted session rather than an error, so confirm the server has encryption on.
  • Trust server certificate skips certificate validation. Enable it only for a server with a self-signed certificate you trust.
  • Named instances are not supported; give the instance a static TCP port and connect to that port.

Workflows built before saved connections keep their inline connection fields and run unchanged.

Use the block

Query, insert, update, delete, execute raw T-SQL, and introspect schemas.

Actions

Microsoft SQL Server Query

Execute a SELECT query on a Microsoft SQL Server database

Inputs and outputs

Input

ParameterTypeRequiredDescription
connectionTimeoutnumberNoConnection and request timeout in milliseconds (default: 15000)
querystringYesT-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.

Output

ParameterTypeDescription
messagestringOperation status message
rowsarrayArray of rows returned from the query
rowCountnumberNumber of rows returned
truncatedbooleanPresent and true only when rows were dropped to stay inside the response ceilings. Absent means the recordset is complete
truncationReasonstringWhich ceiling was hit and how to read the remaining rows

Microsoft SQL Server Insert

Insert data into a Microsoft SQL Server table

Inputs and outputs

Input

ParameterTypeRequiredDescription
connectionTimeoutnumberNoConnection and request timeout in milliseconds (default: 15000)
tablestringYesTable name to insert data into
dataobjectYesData object to insert (key-value pairs)

Output

ParameterTypeDescription
messagestringOperation status message
rowsarrayRows returned by the statement (empty for a plain INSERT)
rowCountnumberNumber of rows inserted
truncatedbooleanPresent and true only when rows were dropped to stay inside the response ceilings. Absent means the recordset is complete
truncationReasonstringWhich ceiling was hit and how to read the remaining rows

Microsoft SQL Server Update

Update rows in a Microsoft SQL Server table

Inputs and outputs

Input

ParameterTypeRequiredDescription
connectionTimeoutnumberNoConnection and request timeout in milliseconds (default: 15000)
tablestringYesTable name to update
dataobjectYesData object with the columns to set (key-value pairs)
wherestringYesWHERE condition identifying the rows to update

Output

ParameterTypeDescription
messagestringOperation status message
rowsarrayRows returned by the statement (empty for a plain UPDATE)
rowCountnumberNumber of rows updated
truncatedbooleanPresent and true only when rows were dropped to stay inside the response ceilings. Absent means the recordset is complete
truncationReasonstringWhich ceiling was hit and how to read the remaining rows

Microsoft SQL Server Delete

Delete rows from a Microsoft SQL Server table

Inputs and outputs

Input

ParameterTypeRequiredDescription
connectionTimeoutnumberNoConnection and request timeout in milliseconds (default: 15000)
tablestringYesTable name to delete rows from
wherestringYesWHERE condition identifying the rows to delete

Output

ParameterTypeDescription
messagestringOperation status message
rowsarrayRows returned by the statement (empty for a plain DELETE)
rowCountnumberNumber of rows deleted
truncatedbooleanPresent and true only when rows were dropped to stay inside the response ceilings. Absent means the recordset is complete
truncationReasonstringWhich ceiling was hit and how to read the remaining rows

Microsoft SQL Server Execute

Execute a raw T-SQL statement on a Microsoft SQL Server database

Inputs and outputs

Input

ParameterTypeRequiredDescription
connectionTimeoutnumberNoConnection and request timeout in milliseconds (default: 15000)
querystringYesT-SQL statement to execute

Output

ParameterTypeDescription
messagestringOperation status message
rowsarrayRows returned by the statement, when it returns a result set
rowCountnumberNumber of rows returned or affected
truncatedbooleanPresent and true only when rows were dropped to stay inside the response ceilings. Absent means the recordset is complete
truncationReasonstringWhich ceiling was hit and how to read the remaining rows

Microsoft SQL Server Introspect

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

Inputs and outputs

Input

ParameterTypeRequiredDescription
connectionTimeoutnumberNoConnection and request timeout in milliseconds (default: 15000)
schemastringNoSchema to introspect (default: dbo)

Output

ParameterTypeDescription
messagestringOperation status message
tablesarrayArray of table schemas with columns, keys, and indexes
↳ namestringTable name
↳ schemastringSchema name (e.g., dbo)
↳ columnsarrayTable columns in ordinal position order
↳ namestringColumn name
↳ typestringData type (e.g., int, nvarchar, datetime2)
↳ nullablebooleanWhether the column allows NULL values
↳ defaultstringDefault value expression
↳ isPrimaryKeybooleanWhether the column is part of the primary key
↳ isForeignKeybooleanWhether the column is a foreign key
↳ referencesobjectForeign key reference information
↳ schemastringReferenced schema name
↳ tablestringReferenced table name
↳ columnstringReferenced column name
↳ primaryKeyarrayPrimary key column names, in key order
↳ foreignKeysarrayForeign key constraints declared on this table
↳ columnstringLocal column name
↳ referencesSchemastringReferenced schema name
↳ referencesTablestringReferenced table name
↳ referencesColumnstringReferenced column name
↳ indexesarrayNon-primary-key rowstore indexes on this table
↳ namestringIndex name
↳ columnsarrayKey columns included in the index, in key order
↳ uniquebooleanWhether the index enforces uniqueness
schemasarrayList of available schemas in the database
Was this helpful?
Suggest an edit