Microsoft SQL Server

Use Microsoft SQL Server to query or modify rows, execute T-SQL, and inspect tables, keys, and indexes. Configure the host, port, database, credentials, and TLS settings for your instance.

Usage Instructions

Integrate Microsoft SQL Server into the workflow. Can 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

Input

ParameterTypeRequiredDescription
hoststringYesMicrosoft SQL Server hostname or IP address
portnumberNoServer port (default: 1433). A named instance must be reached through its static TCP port
databasestringYesDatabase name to connect to
usernamestringYesDatabase username
passwordstringYesDatabase password
encryptstringNoRequest 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
trustServerCertificatestringNoTrust 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
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

Input

ParameterTypeRequiredDescription
hoststringYesMicrosoft SQL Server hostname or IP address
portnumberNoServer port (default: 1433). A named instance must be reached through its static TCP port
databasestringYesDatabase name to connect to
usernamestringYesDatabase username
passwordstringYesDatabase password
encryptstringNoRequest 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
trustServerCertificatestringNoTrust 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
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

Input

ParameterTypeRequiredDescription
hoststringYesMicrosoft SQL Server hostname or IP address
portnumberNoServer port (default: 1433). A named instance must be reached through its static TCP port
databasestringYesDatabase name to connect to
usernamestringYesDatabase username
passwordstringYesDatabase password
encryptstringNoRequest 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
trustServerCertificatestringNoTrust 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
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

Input

ParameterTypeRequiredDescription
hoststringYesMicrosoft SQL Server hostname or IP address
portnumberNoServer port (default: 1433). A named instance must be reached through its static TCP port
databasestringYesDatabase name to connect to
usernamestringYesDatabase username
passwordstringYesDatabase password
encryptstringNoRequest 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
trustServerCertificatestringNoTrust 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
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

Input

ParameterTypeRequiredDescription
hoststringYesMicrosoft SQL Server hostname or IP address
portnumberNoServer port (default: 1433). A named instance must be reached through its static TCP port
databasestringYesDatabase name to connect to
usernamestringYesDatabase username
passwordstringYesDatabase password
encryptstringNoRequest 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
trustServerCertificatestringNoTrust 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
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

Input

ParameterTypeRequiredDescription
hoststringYesMicrosoft SQL Server hostname or IP address
portnumberNoServer port (default: 1433). A named instance must be reached through its static TCP port
databasestringYesDatabase name to connect to
usernamestringYesDatabase username
passwordstringYesDatabase password
encryptstringNoRequest 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
trustServerCertificatestringNoTrust 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
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