Keyboard shortcuts whilst writing queries?

  • It's just occured to me I type the words SELECT, JOIN, WHERE, ORDER BY etc far far too often... is there any option in Management Studio to define ones own keyboard shortcuts? - i.e. Ctrl J is JOIN Ctrl LJ is left outer join etc.

    !? Anyone...

  • SQL 2008 has intellisense in Management Studio. Won't work on 2005 connections, but if you write the query on a 2008 connection (Dev edition maybe), you could then port it to 2005. That would do what you're asking for.

    Another option is write your queries in a better text editor than Management Studio. There are plenty that support things like 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

  • Thanks, I'll look into 2008 - I'd heard but forgotten it had intellisense.

    What other text editors would you reccomend (free of low cost prferably, credit crunch and all that I doubt I'd be allowed to purchase anything expensive!)

  • A custom shortcut I tend to use quite often:

    Go to Tools > Options. Expand Environment > Keyboard.

    Set Ctrl+3 to SELECT * FROM

    Set Ctrl+4 to SELECT TOP 10 * FROM

    Click OK.

    Once this is done, you can highlight any table and press the keys to SELECT from that table. There might be other creative uses for this, but I find the top 10 pretty useful.

  • I can't recommend a text editor. I type 100+ words per minute, so haven't found much use for intellisense, shortcuts, et al.

    - 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

  • Err how about Redgate's SQL Prompt. The best by far

  • Another vote for Red Gate's SQL Prompt. It's better than the intellisense in 2008.

    "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

Viewing 7 posts - 1 through 6 (of 6 total)

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