How to Create an SCRM Stored Procedure

You can create an SCRM 2006 stored procedure by using Object Explorer in SQL Server Management Studio.

As part of report customization, you will often need to update an SCRM 2006 stored procedure. It is safer to create a new copy of the existing stored procedure rather than update the original. This procedure creates a new stored procedure based on the SCRS_GetCompany Stored Procedure used in How to Switch the Filter Order of an SCRM Report. The new procedure is named SCRS_GetCompany_CUSTOM to distinguish it from the original.

Important   Validate all user input. Do not concatenate user input before you validate it. Never execute a command constructed from unvalidated user input.

To create an SCRM stored procedure

  1. In Object Explorer, connect to the SCRM 2006 data warehouse computer and then expand that instance.

  2. Expand Databases, expand the SystemCenterPresentation database, and then expand Programmability.

  3. Right-click Stored Procedures, and then click New Stored Procedure.

  4. From the topic Code Sample: SCRS_GetCompany_CUSTOM SCRM Stored Procedure, copy the SQL code.

  5. In the query editor, replace the stored procedure template by pasting the SCRS_GetCompany_CUSTOM SQL code you just copied.

  6. To test the syntax, on the Query menu, click Parse.

  7. To create the stored procedure, on the Query menu, click Execute.

  8. To save the script, on the File menu, click Save. Accept the file name or replace it with a new name, and then click Save.

See Also

Tasks

Code Sample: SCRS_GetCompany_CUSTOM SCRM Stored Procedure
How to Switch the Filter Order of an SCRM Report

Concepts

About SCRM 2006 Report Customization

Other Resources

Sample SCRM Stored Procedures