Home Forums SQL Server 2008 SQL Server 2008 Administration How did you accumulate and where do you keep your administration scripts (or other scripts for that matter) RE: How did you accumulate and where do you keep your administration scripts (or other scripts for that matter)

  • I keep copies of any script I might need again in SkyDrive.

    DropBox, so far as I know, requires an application to be installed locally before you can access your files. SkyDrive allows access directly in the browser. I've worked in plenty of environments where, when I needed a script, I had internet access, but not the ability/desire to install software on the server or on the computer I was using.

    Google Docs would probably work as well, but I've been using SkyDrive since before Google Docs existed.

    The RedGate tools are great, right up to the point where you have to use a web-based VPN connection from a hotel's "business center" to do something on a server you're responsible for, while you're on vacation and don't have access to your usual workstation or even your home copy of Dev Edition, et al. You'll want your scripts "in the cloud" at that point.

    I've also had scripts I built at prior jobs come in handy in later jobs. Again, since I have them in the cloud (SkyDrive in this case), I can simply download, edit, and use. If I had them stored in a script library on a workstation at a company that's out of business, they would be lost.

    So, use local script management for convenience when you're at work, but make sure to copy them to some online storage solution. One that allows browser access.

    As for where I get them: Many I wrote myself. Some I got from others - on this site or other sites. Some I got from others, then edited for my own use.

    What I have in them is a mix of things I find I universally need (like a script for managing index fragmentation and maintenance), things I don't need often but which were a pain to put together in the first place (some CLR objects that are really useful in limited circumstances, but where Google and Bing failed me in finding what I needed), and some things that took a lot of research and trial and error to build (lots of XQuery examples).

    Basically, there's no need to keep a script I can reconstruct from scratch with a minute's typing. My usual DBCC CHECKDB script doesn't need to be stored anywhere. It's too simple to just rewrite when I need it. But if it would be in any way an effort to reconstruct, I save it.

    For example, I recently had to do a fairly complex XML shred. The documentation on XQuery sucks, and it took hours to figure out how to write the query. Writing it took about 2 minutes, but figuring out what to write, then debugging (largely trial and error), took half a day. Inline comments get added, the file gets a very clear name, and it goes in my online library. I may never use anything like it again, but if I do, I have documentation and sample code now, in a format that is crystal clear to me (since I wrote it). Doing that kind of thing has saved me days, maybe weeks, of work, in many cases. "I know I did this before, but I don't remember how," stops being a significant barrier.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon