Friday, March 20, 2015

Tips & Tricks

Last week I saw Cathrine Wilhelmsen's (b|t) slides of her session at SQLBits XIV: Tools and Tips: From accidental to efficient DWH developer. If you haven't watched the session, go scroll through the slide deck at slideshare right away! It was really useful and though I already knew several of the tips, I got some new ones out of it that I'm using on a daily basis now.

I especially liked the Query shortcuts, where you can set specific queries under e.g. CTRL + [3-9]. If for example you set SELECT TOP 1000 * FROM under CTRL + 3, that way you can select the first 1000 rows of a table by only selecting the table and pressing the shortcut.

I'd like to add a few tips & tricks of my own, mostly being keyboard shortcuts I frequently use.

In SSMS, with nothing selected you can use the following:
  • CTRL + C selects the whole row at your cursor
  • CTRL + X cuts the whole row at your cursor (also works with SHIFT + DEL)
  • CTRL + V pastes the just copied or cut rows at the cursor (also works with SHIFT + INS)
Other tips:
  • CTRL + Click anywhere in a word selects the whole word. If you move the cursor after clicking (and still holding CTRL) you can select more words or even sentences
  • (SHIFT +) F6 scrolls through the available panes of the current tab taking the following into account: current tab, results, messages, execution plan, client statistics.
  • CTRL + SHIFT + U changes the selection to UPPER CASE
  • CTRL + SHIFT + L changes the selection to lower case
  • As Cathrine mentioned: CTRL + U changes the database while you're typing, but it can also be done with ALT + D. I like this shortcut a little more because it can be done with one hand in case you're mousing at the same time.
I hope this was useful to you and you maybe learned something new!

No comments:

Post a Comment