Stored Procedures

Prior to 7.6.0, engagement scoring and involvement were computed using two stored procedures: CRM360_ADD_OVERVIEW_DATA and usp_INSERTUPDATECUSINVOLVEMENTINFO.

 

The main entrance point procedure for engagement scoring, USP_RUNCRM360_SQLJOB, accepts the following parameters:

Parameter Name

Description

@IP_EXECUTION_MODE

Controls the execution mode of the procedure. The values for this procedure can be either “FULL” or “INCREMENTAL”.

 

When set to “FULL” the computations will be executed for the period of time identified by the CUS CRM360_OVERVIEW_YEARS application parameter. For example, if the application parameter is set to a value of 3 then the computations that are executed will go back to January 1 of 3 years ago. If the current year is 2015, the computations will go back to 1/1/2012.

 

When set to "INCREMENTAL", the computations will go back to the date when the procedure was last executed. For example, if the incremental job was last run on 3/3/2015 and then is executed again on 3/16/2015, the computations that are executed will be on data that has been added or modified between 3/3 and 3/16.

 

The default value for this parameter is "INCREMENTAL".

@IP_MASTER_CUSTOMER_ID

An optional master customer ID to indicate that the computations should only be performed for a single customer. If this parameter is not provided, the job will be executed for the entire database.

 

The default value for this parameter is NULL.

@IP_SUB_CUSTOMER_ID

An optional sub customer ID to indicate that the computations should only be performed for a single customer. If this parameter is not provided, the job will be executed for the entire database.

 

The default value for this parameter is NULL.

@IP_PRINT_DEBUG_MESSAGE

An optional parameter to indicate whether or not to print debug diagnostics messages to the SQL Server Management Studio messages window.

 

The default value for this parameter is ‘N’.

As of 7.6.0, the CRM360_ADD_OVERVIEW_DATA stored procedure has been broken out into the following five separate procedures:

Procedure Name

Description

USP_RUNCRM360_SQLJOB

The procedure provides the entry point to the engagement scoring logic. It sets several parameters that are used throughout the engagement scoring functionality and executes CRM360_ADD_OVERVIEW_DATA.

 

It should be noted that the SQL Executive job that executes the engagement scoring procedures on a regular basis should be changed to execute this procedure by passing the explicit values of @IP_EXECUTION_MODE = ‘FULL’ and @IP_PRINT_DEBUG_MESSAGE = ‘N’.

CRM360_ADD_OVERVIEW_DATA

This procedure primarily controls the conditional execution of computing scores, balances, and spending based on the configured value of several application parameters.

CRM360_ADD_OVERVIEW_DATA_BALANCES

This procedure computes the balance for customer records.

CRM360_ADD_OVERVIEW_DATA_SCORING

This procedure computes the engagement scores for customer records. It also executes CRM360_ADD_OVERVIEW_DATA_SCORING_ROLLUP if the CUS  CRM360_ROLLUP_EMPLOYEES_TO_EMPLOYER application parameter is set to "Y".

CRM360_ADD_OVERVIEW_DATA_SCORING_ROLLUP

This procedure computes the scoring and spending for employees to be rolled up to the company record based on the employer master customer ID and employer sub customer ID stored with the records involved in the computations.

CRM360_ADD_OVERVIEW_DATA_SPENDING

This procedure computes the spending values as they relate to engagement. Note that these computations are different from the balance computations, which reflect the actual balance due for a customer in Personify360.