Microsoft SQL Data Stream Parameters

The Microsoft SQL provides configurable data streams to query SQL data.

Each configurable data stream exposes a set of parameters that lets you filter the data you retrieve. The following information describes the available configurable data streams and their parameters in detail.

SQL Metrics Query

Parameter
Description
Query
Enter a SQL query which returns metrics. For example:
SELECT label,timestamp,value FROM MyPerformanceTable WHERE myObjectId = {{sourceId}}

When writing a Metrics query, the below three columns are mandatory and all others will be ignored.
  • label: The label for the value passed in, for example ‘Percent Utilization’. Each distinct ‘label’ value will get its own line color which includes only values for that label.
  • timestamp: A DateTime value of when this reading occurred.
  • value: A numerical non-null value to be visualized.

SQL State Query

Parameter
Description
Query
Enter a SQL query which returns metrics. For example:
SELECT label,timestamp,value FROM MyPerformanceTable WHERE myObjectId = {{sourceId}}

When writing a State query, the below three columns are mandatory and all others will be ignored.
  • label: The label for the state passed in, for example ‘Deliveries’. These ‘label’ values must be distinct and will each produce their own status block
  • id: If this state will be tied to an object, then that object’s sourceId should be used, otherwise passing the ‘label’ value a second time will work effectively.
  • state: The state of the labeled object, options are ‘Success’, ‘Warning’, ‘Error’, and ‘Unknown’.

SQL Stored Procedure

Parameter
Description
Stored procedure name
Enter the name of the stored procedure in the target MySQL database that you want to execute. This must exactly match the procedure name as defined in the database schema.
Input parameters
Click Add new parameter to enable a key:value pair field that lets you pass parameters into the stored procedure when it is executed. These correspond to the procedure’s declared input arguments, with the supplied key being the parameter name and type.
Click Add another parameter to add additional key:value pairs.
Output parameters
Click Add new parameter to enable a key:value pair field that lets you specify the named output variables defined in the stored procedure that will return values after execution, with the supplied key being the parameter name and type.
Click Add another parameter to add additional key: value pairs.
Result type
Select the expected format of the results returned by the stored procedure. Choose from:
  • Result set: Returns rows of data (like a query result).
  • Output parameters: Returns only the defined output parameters from the procedure.

Example

The following parameter configuration will execute the stored procedure below:

  • Stored procedure name: AddTwoNumbers
  • Input parameters:
    • @Number1 int : 3
    • @Number2 int : 4
  • Output parameters: @sum int
  • Result type: Output Parameters

CREATE PROCEDURE [dbo].[AddTwoNumbers] 
   (@Number1 int, @Number2 int, @Sum int OUTPUT)
AS
   SELECT @Sum = @Number1 + @Number2;
​​​​

SQL Table Query

Parameter
Description
Query
Enter a SQL query which returns metrics. For example:
SELECT label,timestamp,value FROM MyPerformanceTable WHERE myObjectId = {{sourceId}}

Was this article helpful?


Have more questions or facing an issue?