Creating Stored Procedures

 

ExpandedToggleIcon        How to Manually Create Storage Metadata Schema Stored Procedure

1.Right-click the Stored Procedures node in the Model Explorer, select Add from the popup menu and then select New Procedure.

Images_model_explorer_sp

2.The Storage Procedure Editor will be displayed.
3.Enter the procedure name into the Name box and specify other procedure parameters:

Images_stored_procedure_editor

4.If the procedure should have parameters, switch to the Parameters tab.
5.Click Add.
6.Specify the parameter settings, e.g. as follows:

Images_stored_procedure_editor_parameters

7.Repeat steps 5 and 6 for all the procedure parameters and click OK.

 

ExpandedToggleIcon        How to Create Procedure from the SQL Code

1.Right-click the Stored procedures node in the Model Explorer, select Add from the popup menu and then select New Command Text.
2.In the displayed dialog enter the Stored Procedure Name and SQL Script.

Images_commandeditor_sp

3.Click OK.
4.If the script contains parameters, you will be asked whether to generate parameters collection. Click Yes to generate it or No to build it later manually.

note Note

If a stored procedure or function exists only in the Storage part of the model, i.e. is not used either in Insert/Update/Delete mapping or in mapping to methods in the Conceptual part, the corresponding warning message is displayed in the Error List window: The storage function '<function name>' is not used by any object in the conceptual model.

ExpandedToggleIcon        See Also


Send feedback on this topic

© 2008 - 2024 Devart. All rights reserved.