Configuring a Stored Procedure

A Stored Procedure is a subroutine attached to a database, capable of performing complex operations using the source data and returning values based on those operations. By creating a Stored Procedure Data Source, you enable a model to execute a stored procedure and fetch the result.

Implementation:

  1. Switch to the Definition tab.
  2. Click to open the Model Data Sources window.
  3. Click or New to open the New Data Source dialog.
  4. Select the A Microsoft SQL Server Stored Procedure radio button.
  5. Click the New Data Source From Stored Procedure button. This will open the KnowledgeKube Data Source dialog.
  6. Use the first drop-down menu to choose a connection that points to the stored procedure.
  7. Use the second drop-down menu to select the intended stored procedure.
  8. Enter a meaningful name to identify the stored procedure within KnowledgeKube.

If you right-click the name field, you can select Use Table Name to auto-fill the name field with the name of the selected stored procedure.

  1. (Optional) To make the data source available to other models in the repository, tick the Shared check box.
  2. Click Save.
  3. Select the new stored procedure in the Your Data Sources list.
  4. Click Parameters to open the Modify Parameters window.
  5. Click Create Alias Details to automatically assign aliases to the input and output parameters of the stored procedure.

Stored procedure aliases are effectively the same as aliases for other types of data source. Input parameters will pass values from a variable or other keyword to the stored procedure, while output parameters will pass values from the stored procedure to the specified model keyword.

  1. Click Save.
  2. Click Close.