Microsoft SQL Server Component
Query and manage data in a Microsoft SQL Server (MSSQL) Database
Component key: ms-sql-server
Description
Microsoft SQL Server (MSSQL) is a popular relational database system. This component allows you to query an MSSQL database.
Instead of generating dynamic queries and sanitizing SQL yourself, you can use generic queries with named parameter placeholders like @variableKey
.
For example, you can enter a query that reads INSERT INTO users (name, email) VALUES (@name, @email)
.
Then, you can enter values with keys
of name
and email
, and whatever values you like.
Values provided for name and email are sanitized automatically.
If you are dynamically generating SQL queries and do not know what parameters you will need ahead of time, create a key/value object in another step and reference them through the Parameters Object input.
In the example above, you could generate an object of the form {name: "John doe", email: "john.doe@example.com"}
.
Connections
MS SQL Server Connection
The MS SQL Server username and password can be put directly into a connection, alongside the database host, port, and database name.
On-prem enabled: this connection can be configured to connect to an on-prem resource on a private network. Learn more.
Input | Default | Notes | Example |
---|---|---|---|
Connection Timeout string connectionTimeout | 15000 | The number of milliseconds before the attempt to connect is considered failed. | 15000 |
Database string / Required database | Provide a string value for the name of the database. | msdb | |
Host string / Required host | Provide a string value for the address that your database server is hosted on. | 192.168.0.1 | |
Password password password | |||
Port string / Required port | 1433 | Provide a string value of the port your database server is exposing. | |
Username string username |
Actions
Execute Stored Procedure
Execute a stored procedure on a Microsoft SQL Server Database | key: execute
Input | Default | Notes | Example |
---|---|---|---|
Connection connection / Required sqlConnection | |||
Stored Procedure string / Required storedProcedure | The name of the stored procedure to execute. | myStoreProcedure | |
Timeout string timeout | 60000 | 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. |
Query
Interact with a Microsoft SQL Server Database | key: query
Input | Default | Notes | Example |
---|---|---|---|
Parameters data Key Value List params | Optional parameters to insert into a query. | ||
Parameters Object code paramsObject | Optional parameters to insert into a query. This should be a key-value object. Values from this object will be merged with Parameters inputs. | ||
Query code / Required queryField | Provide a string containing a query that will be executed by the Microsoft SQL-Server database. You can pass in optional named parameters using the '@variable' operator. | ||
Connection connection / Required sqlConnection | |||
Timeout string timeout | 60000 | 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. |