Debugging, editing, and running routines that are in database modules

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:

  1. 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.
  2. 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.

  3. Complete the wizard. The routine is redeployed and can be debugged.

  4. 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.
  5. 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.

  6. Deploy the routine from the routine editor. Click Deploy the routine to the database server button.

    When the updated routine is deployed, it replaces the routine in the database module.

  7. Run or debug the routine from the routine editor.
    • To run the deployed routine, click Run the routine on the database server button.
    • If you enabled debugging, click Debug the deployed routine on the database server button to debug it.

What to do next

To disable debugging for the routine, clear Enable debugging when you deploy the routine.


Feedback