SQL library - best practices

  • I am part of a local group of analysts, and also part of the enterprise-wide analyst collective (resistance is futile) and people keep bandying about the idea of a script library that would also be a 'best practices' kind of resource. I like that idea, and within my local group, I'd also like to implement more specific scripts or snippets of code that we could reuse, and help keep things standardized in our report generation.

    I'm partial to saving things like this as templates, because I can drag and drop to use them quickly. Anyway, on to my question - has anybody implemented this sort of idea within their own workgroups, and if so, how? Do you have suggestions, "lessons learned", etc? How do you deal with different coding styles when collecting snippets? (i.e. aliases - I hate em and avoid them like the plague, everyone else under the sun uses them) We would have the option of Sharepoint or a shared drive to save our code, and then people could save into their templates if they're lazy like me.

    Or is this a dumb idea?

    ---------------------------------------------------------
    How best to post your question[/url]
    How to post performance problems[/url]
    Tally Table:What it is and how it replaces a loop[/url]

    "stewsterl 80804 (10/16/2009)I guess when you stop and try to understand the solution provided you not only learn, but save yourself some headaches when you need to make any slight changes."

  • We've used templates before, putting them on a shared, standard mapped drive for everyone. It has worked OK, set them to read only, prevent changes, let everyone get to them.

  • The way you deal with different coding styles is by insisting that there only be one coding style. Publish and enforce a set of standards including such arcane things as proper casing, etc, that must be met and that should include some pretty decent documentation including how it's used. It doesn't have to be as "bad" as the "Code Project" code, but if it's not clear what a script or code snippet does and it's need readable, it's not worth having it in the library.

    --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)

  • *considers a world without aliases*

    ...

    *dies a little inside*

    ...

    *goes to get a beer*

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. πŸ˜‰

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • heh... you forgot the last step, Seth...

    * pensively turns beer into lager *

    πŸ™‚

    --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)

  • We use an approach similar to the following:

    http://www.sqlservercentral.com/articles/System+Development+Life+Cycle/62933/

    From a technical standpoint it works well as a script distribution mechanism but I doubt we have realized much in the way of knowledge sharing.

    The biggest failing has always been search and retrieval. It’s easier to ask a colleague, search the web or build from scratch than to try and find something in most of the corporate repositories, wikis and intranets that I have used.

  • Eric Klovning (10/19/2008)


    We use an approach similar to the following:

    http://www.sqlservercentral.com/articles/System+Development+Life+Cycle/62933/

    From a technical standpoint it works well as a script distribution mechanism but I doubt we have realized much in the way of knowledge sharing.

    The biggest failing has always been search and retrieval. It’s easier to ask a colleague, search the web or build from scratch than to try and find something in most of the corporate repositories, wikis and intranets that I have used.

    Thanks for the link, and I agree that unless you can find a *good* description of what it does quickly, storing all the code snippets in the world won't be a bit of help. Will be working on some sort of education for the team to get them looking for the same keywords in the same places to find what they need quickly.

    And then google it, and end up here. πŸ˜‰

    ---------------------------------------------------------
    How best to post your question[/url]
    How to post performance problems[/url]
    Tally Table:What it is and how it replaces a loop[/url]

    "stewsterl 80804 (10/16/2009)I guess when you stop and try to understand the solution provided you not only learn, but save yourself some headaches when you need to make any slight changes."

Viewing 7 posts - 1 through 6 (of 6 total)

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