Feedback

  • Contents
 

Stored Procedure

Use the Edit Stored Procedure Activity dialog box to specify the criteria for running a stored procedure.

The simplest way to apply custom logic to a workflow is to create a stored procedure that the Stored Procedure activity can run. The stored procedure works with WorkFlow Designer using the #WorkFlowExec and #WorkFlowAcct temporary tables. The Stored Procedure activity handles moving all affected accounts to the next activity in the workflow. The following is an example of a stored procedure for WorkFlow Designer:

CREATE PROCEDURE [dbo].[WorkFlow_AddCustomNote]

@Action VARCHAR(5),

@Result VARCHAR(5),

@Comment VARCHAR(255)

AS

INSERT INTO [dbo].[Notes] ([number], [user0], [created], [action], [result], [comment]

SELECT [AccountID], 'WorkFlow', GETDATE(), @Action, @Result, @Comment

FROM #WorkFlowAcct;

Some stored procedures can accept parameters and you can specify those parameters in the Stored Procedure activity.

To modify a Stored Procedure activity

  1. Create or open a workflow with a Stored Procedure activity. For more information, see Create a Workflow or Modify a Workflow.

Stored Procedure activity

  1. On the workflow tab, double-click the Stored Procedure activity. The Edit Stored Procedure Activity dialog box appears.

Edit Stored Procedure Activity dialog box

Stored Procedure: Stored procedure to run.

  1. In the Stored Procedure list box, do the following:

    1. Click the Search icon. The Select Stored Procedure dialog box appears.

    2. Click the stored procedure and then click Open. WorkFlow Designer populates the Stored Procedure box in the Edit Stored Procedure Activity dialog box with the specified stored procedure. If the stored procedure accepts parameters, they display in the box. When you select a parameter, as in the example, the type of data and maximum length appear in the lower section of the dialog box.

Edit Stored Procedure Activity dialog box - parameters

  1. To specify values for the parameters, in the box next to a parameter, type a value.

  2. Click OK. WorkFlow Designer updates the Stored Procedure activity in the workflow.

Related Topics

Action Activities