New Report sp_DBR Skeleton

(3 posts) (2 voices)

Tags:

No tags yet.

  1. aball, Member

    When adding a new report myDBR prepares a skeleton procedure for you, for example:
    CREATE PROCEDURE sp_DBR_demo_continents
    AS

    However while working on this procedure you may need to save it a few times and this causes an error that this procedure already exists.

    I suggest starting the new skeleton with a conditional "drop" statement instead, for example:
    if object_id('sp_DBR_demo_continents','P') is not null
    drop procedure sp_DBR_demo_continents
    go
    CREATE PROCEDURE sp_DBR_demo_continents
    AS

    This way the user can save the procedure as many times as they want while working on it with no errors.

    Thanks.

  2. myDBR Team, Key Master

    Leaving out the "drop procedure" when creating a new report is by design. This prevents the user from accidentally dropping an existing routine and potentially losing code in case (s)he tries to create a routine that already exists in the db.

    What you can do after the routine is initially created, is to highlight the routine name and to click the "Show selected object"-button. This will open the routine to a new tab with the "drop procedure" condition.

    --
    myDBR Team

  3. aball, Member

    Ah OK.. good idea leaving it like that then. Thank you.


Reply

You must log in to post.