locked
Document stored procedures. RRS feed

  • Question

  • Hi experts,

    I manage a sql server instance with hundreds of SPs/functions, with almost no comments/documentation. Even the names of the SPs/functions aren't really descriptive.

    I wanted to go to each SP/function and document it.

    Is there a formal classification of SPs/function? I wanted to divide them in "classes" like ( yes,no), for like:

    • returns results.
    • update/delete/insert data.
    • input parameters.


    I also thought of describing which tables the SP/function touches, and briefly stating what the it does... What is the standard documentation? is there one?

    Saturday, September 7, 2019 4:16 PM

All replies

  • I would guess that there aare as many standards as there are SQL programmers out there. Or at least as many standards as there are SQL programmers who write documentation.

    A common division of stored procedures are read procedures and action procedures, but far from all system are clearcut. In a system I'm working with replacing, I've found that despite that I only run the application to view data, I can see my user id as responsible for having added data. That is, procedures to retrive data appears to set up stuff while they're at it. And in another system I've been working with, modern update procedures returns the inserted/updated data the last thing you do.

    So pick a division that makes sense with the system you have.

    As for a tool for documentation, have a look at Red Gate's SQLDoc.


    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

    Saturday, September 7, 2019 5:10 PM
  • I would guess that there aare as many standards as there are SQL programmers out there. Or at least as many standards as there are SQL programmers who write documentation.

    OMG, ROFLMAO!  Perfectly said!  Of course that second number approaches zero very closely.

    I'm one of those odd ones who does documentation, but even I haven't done an external list of SPs for a long … ok, probably never, certainly not in the last ten years.

    You do have the Help SP's that will give you some where-used information, but perhaps there's no point in printing it all out and putting it on the shelf, it all changes too quickly, even on stable systems, and anyway it's available online so why bother?

    Josh

    Sunday, September 8, 2019 1:21 AM