Add a Stored Procedure for a Table or View
You can add a new stored procedure in a physical model using the Stored Procedure Editor. The order in which you add stored procedures to your model is important. The stored procedure code is generated according to the order the stored procedures display in the Stored Procedure Editor. You can change this order at any time by using the up and down arrow buttons on the Object Creation Order tab in the Stored Procedure Editor.
To add a new stored procedure
- Click Stored Procedures on the Model menu.
The Stored Procedure Editor opens.
- Click the New
button.
A new stored procedure is added to the Navigation Grid with a default name. You can change the name in this field.
- Work with the following options:
- Name
Specifies the name of the stored procedure. Change the name of the stored procedure in this field.
- Type
Specifies whether the stored procedure type is model-level or table-level. Select the type from the drop-down list.
- Attach To New
Specifies to attach the selected stored procedure to each new table or view that you create. Clear the check box if you want to manually attach the stored procedure to new tables or views.
- Generate
Generates SQL during forward engineering. Clear the check box if you do not want to generate SQL.
- Work with the other tabs in the editor to access additional design features, such as:
- Define the code type in the Code tab
- View expanded code in the Expanded tab
- Specify the order of DDL generation in the Object Creation Order tab
- View where the stored procedure is used in the model in the Where Used tab
- Click the Stored Procedure Browser button
to attach tables and views in the model to the stored procedure.
- (Optional) Click the Comment tab and enter any comments that you want to associate with the stored procedure.
- (Optional) Click the UDP tab to work with user-defined properties for the stored procedure.
- (Optional) Click the Notes tab to view history information and view or edit user notes.
- Click Close.
The stored procedure is added and the Stored Procedure Editor closes.
Copyright © 2020 erwin, Inc.
All rights reserved.
|
|