Microsoft SQL Server: Client
Summary
This module contains actions for running queries & stored procedures on a Microsoft SQL Server.
Running Queries
See Using Placeholders before using the select, insert, & update actions.
Placeholders are not required when using the stored_procedure action.
Actions
mssql.client.
input_table
Display a list of records in a table, & allow the task operator to make a selection.
Minimum Plugin Version: 2.0.0
Input
-
text: the title of the table
-
records: a list of dictionaries to display in the table
-
minimum: The minimum number of acceptable selections (Optional)
-
maximum: The maximum number of acceptable selections (Optional)
Output
A list of dictionaries.
Tip
-
If neither a
minimum
ormaximum
is provided, the task operator will be able to submit 0 selections. -
If
minimum
ormaximum
are provided, the operation will repeat until a valid number of selections is made.
Example
Getting all records from a users table, displaying it and waiting for a single selection:
1 2 3 4 5 6 7 8 9 10 11 12 |
|
mssql.client.
insert
Run an INSERT SQL query.
Minimum Plugin Version: 2.0.0
Input
-
mssql: an MSSQLServer dictionary
-
query: the SQL Query to run
-
placeholders: Optional Placeholders to format in to the SQL query before it is executed.
Output
Nothing is outputted by this action.
Example
1 2 3 4 5 6 7 |
|
mssql.client.
output_table
Display a list of records in a table.
Minimum Plugin Version: 2.0.0
Input
-
text: the title of the table
-
records: one or more records outputted by select
Output
Nothing is outputted by this action.
Example
Getting all records from a users table and displaying it:
1 2 3 4 5 6 7 8 9 10 |
|
mssql.client.
select
Run a SELECT SQL query.
Minimum Plugin Version: 2.0.0
Input
-
mssql: an MSSQLServer dictionary
-
query: the SQL Query to run
-
placeholders: Optional Placeholders to format in to the SQL query before it is executed.
Output
Either a:
-
List of dictionaries containing the query results
-
Empty list if the query returned no data
Tip
For more information regarding the output from this action, see Running Select Queries.
Example
1 2 3 4 5 6 7 |
|
mssql.client.
stored_procedure
Run a stored procedure.
Minimum Plugin Version: 2.0.0
Input
-
mssql: an MSSQLServer dictionary
-
name: the name of the stored procedure (must start with sp_)
-
parameters: Optional dictionary of parameters to pass in to the stored procedure
Filtered Column Types
Only columns with the following data types are outputted by this action:
- text (
string
) - numbers (
integer
&float
) - boolean (
true
&false
) - null
Columns such as SID are removed as PPA receives them in bytes format, which is not JSON compatible.
Output
A list of dictionaries.
Example 1 - Without Parameters
1 2 3 4 5 |
|
Example 2 - With Parameters
1 2 3 4 5 6 7 |
|
mssql.client.
update
Run an UPDATE SQL query.
Minimum Plugin Version: 2.0.0
Input
-
mssql: an MSSQLServer dictionary
-
query: the SQL Query to run
-
placeholders: Optional Placeholders to format in to the SQL query before it is executed.
Output
Nothing is outputted by this action.
Example
1 2 3 4 5 6 7 |
|