October 30, 2009 at 3:32 am
I am interested in what people use to store useful t-sql code that they come across. I'm talking about little gems like using ALTER DATABASE to move ldf's and mdf's to different file locations, running sp_cycle_errorlog to recycle the SQL Log, determining orphaned users in a database, testing for null SQL passwords etc etc. The list is endless...
Whilst I appreciate a lot of this information can be found in BOL, a lot of it is also found online within sites like this one. Rather than bookmark each useful page I come across it would be nice to have some sort of repository and I don't mean something like SubVersion (or similar) which seems like overkill for what I want.
At the moment i'm using Excel but there must be something better out there for this.
Any Ideas?
October 30, 2009 at 3:48 am
For different DDL Statements (CREATE, DROP), Template Explorer in SSMS is the best place to get the idea and then BOL.
For scripts, it depends upon your needs. I personally have a folder containing all the queries that I know i cant remember for a long time.
Not found any specific website for that. It might be due to fact that it depends on each individual's need....
October 30, 2009 at 5:45 am
I setup a SharePoint web site that I share out to the rest of the company. As I find useful scripts, I post them out to the site. I don't have to worry about losing them since their on a regular backup.
For the scripts that I use most often, I put them in a scripts work folder
For better, quicker answers, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
October 30, 2009 at 6:15 am
Small scripts that I use all the time go into Red Gate SQL Prompt. Bigger scripts go out to a sharepoint site. All our projects are built from source control, so we have scripts in VSS or TFS, depending on the age of the project.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
October 30, 2009 at 7:15 am
i use the cliptext feature of Editplus to save all my snippets and valuable code; i try to organize with a keyword and brief description;
if i double click on the line on the left, the full snippet, which might be hundreds of lines of code, appears in the document i'm editing.
Lowell
October 30, 2009 at 7:32 am
Thanks for all the responses. Lowell that's exactly what i'm after do you know of a free alternative to EditPlus?
Cheers,
Mark
October 30, 2009 at 7:40 am
I keep two folders on the micro-SD card in my phone, one for administrative scripts (things like backups and index maintenance), and one for clever stuff (like string parsing, Numbers table creation, a clever string concatenation script, running totals, etc.). Any standard USB cable allows me to transfer those to and from my workstation, where I maintain copies of the same scripts.
Can't see a reason to go any more complex than storing them in the file system.
- 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
October 30, 2009 at 7:46 am
Hi,
I have a seperate database for all my "utility" scripts, stored as procedures.
I seperate the funtionality of each script with schemas.
It's good because you can automate the backups which are then portable and it requires no extra effort to open windows folders or third-party software etc... simple solution.
:w00t:
October 30, 2009 at 7:51 am
Shabba (10/30/2009)
Thanks for all the responses. Lowell that's exactly what i'm after do you know of a free alternative to EditPlus?Cheers,
Mark
the unregisted version of Editplus is free, with only a single nag screen at startup. it is completely full featured, with just a reminder screen .
Lowell
October 30, 2009 at 8:12 am
the unregisted version of Editplus is free, with only a single nag screen at startup. it is completely full featured, with just a reminder screen .
hmmm... can only seem to find the 30 Day Evaluation Version?
October 30, 2009 at 8:16 am
Shabba (10/30/2009)
the unregisted version of Editplus is free, with only a single nag screen at startup. it is completely full featured, with just a reminder screen .
hmmm... can only seem to find the 30 Day Evaluation Version?
yep that's it; i'm on day 1066 + of the 30 Day Evaluation Version. like i said, just a nag screen at startup. enjoy!
Lowell
October 30, 2009 at 8:33 am
I posted a similar question a few months ago... you may want to have a look at some of the suggestions there
http://www.sqlservercentral.com/Forums/Topic766956-61-1.aspx
October 30, 2009 at 8:53 am
yep that's it; i'm on day 1066 + of the 30 Day Evaluation Version. like i said, just a nag screen at startup. enjoy!
LOL - thanks mate
@ Ian Scarlett - I'll take a look, thanks.
October 30, 2009 at 9:55 am
I just re-installed notepad++ this morning with the intention of using it instead of notepad for all of my quick ad hoc notes to myself and possibly more. Does anyone know if it t has the same type of script library that I see in Lowell's screenshot? If not, I may be jumping on the EditPlus bandwagon. Not really in love with either yet, so the switch would be easy. Any other reasons to use one over the other?
October 31, 2009 at 2:13 pm
I use Action Outline. It is wonderful and is very much like windows explorer with the tree / branch structure. I couldn't live without it. I keep all my code snippets in there.
Viewing 15 posts - 1 through 14 (of 14 total)
You must be logged in to reply to this topic. Login to reply