How do you manage your code snippets/documentation?

  • The .sql file that I started using to store interesting bits of code, things I wanted to play with, general interest, etc., is growing rather large and unwieldy. I'm trying to find a solution to break out and manage/document things. My company has a Wiki, but companies aren't forever. I would like it to be sort of private, preferably free, and, you know, internetted.

    I guess GitHub is the obvious choice for a lot of people, but I've never used it.

    Thanks

  • erikd (7/9/2013)


    The .sql file that I started using to store interesting bits of code, things I wanted to play with, general interest, etc., is growing rather large and unwieldy. I'm trying to find a solution to break out and manage/document things. My company has a Wiki, but companies aren't forever. I would like it to be sort of private, preferably free, and, you know, internetted.

    I guess GitHub is the obvious choice for a lot of people, but I've never used it.

    Thanks

    Interesting you should ask...I have used a program called CodeBox for several years. However, I have only the demo version and have outgrown the demo size. Interestingly when I clicked on the website link in the program a few months ago I was taken to a site that is...well...not exactly HR friendly. Needless to say, the company has obviously gone the way of the dodo bird. Just a couple weeks ago I was thinking I need to get back to my own implementation and I am very nearly complete with an asp.net version. This is still the first draft but I have everything finished but the Delete function. I would be happy to send it your way if you would be willing to offer some feedback.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

  • Hi Sean,

    I'd be happy to. Send it along.

    Thanks

  • Give me a couple days to get it all cleaned up and I will send it along.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

  • i'll throw my two cents in;

    I use a combination of saved scripts in a specific folder(lazily using C:\Users\<username>\Documents\SQL Server Management Studio\Projects, and that folder has subfolders and hundreds, probably thousands of files.

    for shorter snippets, i use the cliptext feature of editplus, which is a syntax highlighting text editor. it has a boatload of nice features,a nd helps me edit all types of text files, and really powerful macro features.

    it has a nice feature where i can give something a short description, and double clicking that description pastes the codeblock associated into the current text document.

    it supports multiple groups of snippets, so i have them grouped for every version of SQL(ie sql2005/08/2012.

    I grab any interesting snippet form the forums here, and save them constantly; i shudder to think how many snippets i have actually saved over the years. I've never tripped over a size limit for the collection, but have found it sometimes replaced the carat symbol^ that exists in my snippets from version2 to version3 during an upgrade

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Thanks, Lowell. Is your library at all portable? I find myself working from several computers, and several more term servers, so it's helpful for me to be able to access my bits and pieces from multiple places. Right now it's a shortcut to a file on DB. Which is part of why things are turning unwieldy.

  • Here is a screen shot of what I have been working on.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

  • erikd (7/10/2013)


    Thanks, Lowell. Is your library at all portable? I find myself working from several computers, and several more term servers, so it's helpful for me to be able to access my bits and pieces from multiple places. Right now it's a shortcut to a file on DB. Which is part of why things are turning unwieldy.

    EditPlus2 is portable, and just comes up with a nag screen on startup about registering(you are on Day 439 of 30 day trial period). That's what i keep on my PortableApps drive.

    EditPlus3 quits after a defined testing period, and so it's not portable...but the files (ie SQL2012.ctl) are the exact same format, so a quick robocopy when i need to capture new snippits works fine.

    I can throw you my PortableApps folder for it if you think it's worthwhile.

    Also, for portable apps, Linqpad is my goTo for a SSMS replacement when it's not installed and I'm doing consulting, or otherwise don't have access to SSMS:

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Sean, that looks awesome.

    Lowell, if you mean the folder full of all your wisely written code that a scrub could learn from, then yes. Otherwise, I can probably set something similar up when I get a chance to mess with it.

  • Didn't know EditPlus did that, though I use that for lots of stuff.

    I have started using GitHub for keeping code sync'd between machines. Like that for now.

  • Thanks Lowell, I'm going to give LINQPad a try. 🙂

  • Sean - If you're willing to share and would d like another beta tester, please add my name to the list. I'd love you see what you've come up with.

    I also keep my scripts on my hard drive and also write SQL templates for use in SSMS for some things when I have the time. I know keeping things on a local hard drive is not good disaster planning, but I back it up...occasionally...okay, very occasionally. 😀 I've been thinking of writing a client to manage all this, but simply haven't gotten to it yet.

Viewing 12 posts - 1 through 11 (of 11 total)

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