stored procedure header

  • We have 60 stored procedures without headers. now we need to include below details in all sp. Is there any workaround to include below details in all sp to avoid manual work.

    Object :

    Description :

    Author :

    Revision :

    Usage :

    Created :

    Modified

  • You could script out all the procedures and use a text editor to replace "ALTER PROCEDURE" with your header + "ALTER PROCEDURE" in all the files.

    -- Gianluca Sartori

  • gugan_ta (2/3/2012)


    We have 60 stored procedures without headers. now we need to include below details in all sp. Is there any workaround to include below details in all sp to avoid manual work.

    Object :

    Description :

    Author :

    Revision :

    Usage :

    Created :

    Modified

    Well... since most of that data will be particular for each storedproc I think that the sensible solution is to add the header manually to each procedure.

    _____________________________________
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at Amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
  • And 60 isn't that many... I was involved in doing it for closer to 600.

    It's a good practice and requires you to review older stored procs. Another good practice.



    --Mark Tassin
    MCITP - SQL Server DBA
    Proud member of the Anti-RBAR alliance.
    For help with Performance click this link[/url]
    For tips on how to post your problems[/url]

  • gugan_ta (2/3/2012)


    We have 60 stored procedures without headers. now we need to include below details in all sp. Is there any workaround to include below details in all sp to avoid manual work.

    Object :

    Description :

    Author :

    Revision :

    Usage :

    Created :

    Modified

    About the only three things that don't require human knowledge in all of that are the Object, Created, and Modified lines. I agree with what has already been said... it's really not worth trying to automate this and would likely take more time than just copying and pasting a header and manually filling in the blanks.

    The exception would be if someone was fairly diligent with extended properties. Considering that no one was thoughtful enough to add a header, it's unlikely they thought about embedded documentation in the extended properties so that probably won't work.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply