You can debug routines that are deployed in database modules.
If needed, you can edit the routine and then deploy and run the updated
routine.
Before you begin
A database module must contain routines that can be modified
and deployed from the workbench.
About this task
If a routine in module is not performing properly, you can
debug the routine from the workbench. To change the routine, you edit
a copy of the routine in the routine editor. You can test your changes
by deploying and running the updated routine. When you deploy the
routine, you replace the existing routine in the module.
Tip: From
the Properties view, you can view module and
routine properties including routine source code.
Procedure
To debug, edit, and run a routine that is in a module:
- In the Data Source Explorer, connect
to the database and navigate to the module that contains the routine. A Modules folder is in each schema of
the Schemas folder.
- Deploy the routine for debugging. Right-click
the routine and click Deploy to open the Deploy
Routines wizard.
When deploying the routine, enable
debugging by selecting Enable debugging in
the Routine Options page of the wizard.
- Complete the wizard. The routine is redeployed
and can be debugged.
- Start the debugger. Right-click the routine and click Debug. With the debugger, test the routine to find errors that
occur when running the routine.
- If needed, edit the routine. Right-click the routine and
click Open with Routine Editor.
A
copy of the routine opens in the routine editor.
You can save
the routine as a file on your computer. The saved file contains the
routine source code and property information from the database.
- Deploy the routine from the routine editor. Click
. When the updated routine
is deployed, it replaces the routine in the database module.
- Run or debug the routine from the routine editor.
- To run the deployed routine, click
.
- If you enabled debugging, click
to debug it.
What to do next
To disable debugging for the routine, clear Enable
debugging when you deploy the routine.