T-SQL Code Bank

  • Hi,

    I was wondering if anyone had any interesting tools/solutions for creating a library of T-SQL scripts - i.e. compiling all of my saved .sql scripts in some sort of document/app that could then be searched for some syntax that I want to look at.

    It would be especially cool if this could be integrated into BOL, but that might just be crazy talk. 😀

    Thanks,

    Simon

  • don't know about others, but i use EditPlus for my text/sql editor. it has syntax highlighting,a nd has the ability to keep an unlimited number of scripts and snippets at your finger tips.

    every time i find a handy script, i just give it an alias and paste it into the "Cliptext" window.

    it also has the ability to do regular expressions and macros on the data, so if i had a tablename highlighted for example, i could run a script to make a long set of say procs for insert/update/delete, and it would paste the tablename into the right spots during the macro execution.

    here's a screenshot, the list on the left is just one of many panels for SQL, oracle, HTML, and other snippers i want to keep:

    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!

  • I concur with Lowell, Editplus is very decent tool for code and it has templates integrated which can be customized aswell. Trial out the trail edition of Edit Plus.

    Prasad Bhogadi
    www.inforaise.com

  • I too like EditPlus but I do my SQL code editing in SQL Server Management Studio. I add my code snippets to the Template Explorer. It has a similar functionality to ClipText in EditPlus. Double-clicking the saved snippet in Template Explorer pastes it into the query editor code window. In addition, we create custom templates for creating stored procedures.



    Terri

    To speak algebraically, Mr. M. is execrable, but Mr. C. is
    (x+1)-ecrable.
    Edgar Allan Poe
    [Discussing fellow writers Cornelius Mathews and William Ellery Channing.]

  • Edit Plus here as well. I use it for SQL, HTML, and writing.

    I have tended to still use QA, though I don't use templates a lot. Often I just cut and paste a slice out of a stored proc that is similar to what I'm doing or I've saved scripts in My Documents that I use often.

  • Template Explorer is improved and easier to use in SSMS than in QA. We have switched to SSMS because of the integration with SourceSafe



    Terri

    To speak algebraically, Mr. M. is execrable, but Mr. C. is
    (x+1)-ecrable.
    Edgar Allan Poe
    [Discussing fellow writers Cornelius Mathews and William Ellery Channing.]

  • What about searching?

    Can you search through your saved scripts in EditPlus for keywords?

    I fiddled around with Template Explorer, and the functionality is pretty limited.

  • there's no builtin search specific to the cliptext window, but the file of snippets you collect is saved in the \EditPlus 2\ folder as a text file ending in .ctl, so you could open that file up to search all the saved scripts for a string; if you give your snippet a decent name/alias, you won't need to do that too often.

    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!

  • Since the files are saved as text, you can use any of the usual desktop search tools to index them.

    Or save them in a database as text and use full text indexing to find them. But desktop search tools are easier.

    Windows has one built in. Google has one you can add in to Windows. Pick your poison on that.

    - 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

Viewing 9 posts - 1 through 8 (of 8 total)

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