Guest Editorial: In Praise of Templates

  • JoeA (2/6/2009)


    Nope, it was for Mr. Icocks, who said his key combo didn't work in SSMS 2008 🙂

    :blush:

    ---------------------------------------------------------------------

  • Good article Phil. I got to

    when some shinier bead rolled into view

    and it put me in mind of my cats. 🙂

    Then I saw your create table template. 🙁

    ATBCharles Kincaid

  • I'm a big fan of template use. They do save so much time, especially when you use templates for the big stuff like stored procedures. However, since I store all my procs, functions, views, etc. in MS Word documents, I use MS Word templates for my personal on-going use. It works great.

    Here's a thought: One plus a Word template would have over SSMS would be that they can be stored on shared drives and used by a team instead of just one person.

    Just sharing in case someone else is curious how that option works.

  • For most of my direct DB work I use SQuirreL SQL (http://www.squirrelsql.org/) It is a powerful database front end tool that runs across a wide range of databases. It has a rich set of plugins (that I don't take enough advantage of) as well as great out-of-the box functionality. It runs on Mac, Linux, Unix and windows. I find it much more productive than the MS Studio for quick database exploring and running ad-hoc scripts. It is really nice having the same tool no matter what machine and database I have to look at.

  • This time last year I wrote about how to share templates within a team of DBAs http://www.sqlservercentral.com/articles/System+Development+Life+Cycle/62933/

    I use templates in conjuncton with the SQL Prompt and the combination of the two is greater than the sum of the parts.

    What SSMS needs is a simple macro language. Something a bit more than SQLCMD mode but not as heavy weight as powershell.

    What SQLPrompt needs is a few more constructs like their $CURSOR$ place marker.

    $DATE.YMD$ would be useful as would $USER$, particularly as my company shares the SQL Prompt 3 Snippets.XML file between DBAs.

  • Thank you, Phil. I have had a rainy Friday afternoon of fun - thinking up new and exciting ways to use templates!!

    Once I got the hang of the newtemplate/edit/save, I realized that through simple cut and paste into notepad or word, I can build a directory of custom templates to hand out to team members or new installs.

    A great way to share standard formats....

  • We've been using templates at our organization for sometime now - love 'em. Great for getting consistency across db developers and enforcing standards. The one problem, which you mentioned, is the inability to share the templates in a central location. I'm hoping MS comes out with a solution in the near future.

    Cheers,

    Andy

  • I use templates in conjunction with the SQL Prompt and the combination of the two is greater than the sum of the parts.

    What SQLPrompt needs is a few more constructs like their $CURSOR$ place marker.

    David, I've been pestering the SQL Prompt team about this for years. Both snippets and templates are 'work in progress' and, with a bit of effort, could be finished off to provide all sorts of great aids to productivity. You can do wonderful things with this sort of technology.

    I wrote a template Wiki that actually executed the macros and allowed team workers to add and change templates from a central location. It used the Prettifier to display the templates nicely and you could browse through them very easily and search like lightening. The Devs didn't 'Get it'!

    Best wishes,
    Phil Factor

  • Phil Factor (2/7/2009)


    David, I've been pestering the SQL Prompt team about this for years.

    Here would be a booster to aid in acceptance. Since lots of us developers embed SQL into our code it would be nice to provide copy and paste functionality that would put the SQL code into a string variable. Someone sent me a jar file with a SQL formater that does this. I can copy my old code in, it strips it down to SQL, reformats the SQL statement, and lets me put the code wrapper back on.

    ATBCharles Kincaid

Viewing 9 posts - 16 through 23 (of 23 total)

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