SQL SERVER – Switch Between Two Parenthesis using Shortcut CTRL+]

Earlier this week I wrote a blog post about SQL SERVER – CTRL+SHIFT+] Shortcut to Select Code Between Two Parenthesis, I received quite a lot of positive feedback from readers. If you are a regular reader of the blog post, you must be aware that I appreciate the learning shared by readers.

Here is another interesting shortcut shared by another SQL Server Expert – Suvendu. He has suggested that using shortcut CTRL+] one can jump between two parenthesis in the code. This is indeed interesting. You can try it out using the following script.

SELECT *
FROM (SELECT *
FROM (SELECT *
FROM (SELECT *
FROM Sales.Currency)a)b)c

Now, move your mouse right behind b (which is highlighted).

SELECT *
FROM (SELECT *
FROM (SELECT *
FROM (SELECT *
FROM Sales.Currency)a)b)c

Now press CTRL+] and you will see that it jumps from b to the opening parenthesis.

SELECT *
FROM (SELECT *
FROM (SELECT *
FROM (SELECT *
FROM Sales.Currency)a)b)c

You can once again press CTRL+] and it will jump back to parenthesis after b.

SELECT *
FROM (SELECT *
FROM (SELECT *
FROM (SELECT *
FROM Sales.Currency)a)b)c

Small but very useful tip. Try it out and let me know if there is any other important shorcut I should highlight on the blog.

Reference: Pinal Dave (https://blog.sqlauthority.com)

SQL Shortcut
Previous Post
SQL SERVER – Effect of Case Sensitive Collation on Resultset
Next Post
SQL SERVER – Example of Width Sensitive and Width Insensitive Collation

Related Posts

5 Comments. Leave new

  • Just move your cursor right of a paranthesis and see the corresponding opeing and closing paranthesis are highlighted

    Reply
  • Thanks Pinal Sir for the appreciation. This post is perfectly alright except the part ‘SQL Server Expert’ because I am still in the ‘Beginners’ level. However, your recognition and appreciation motivates me to learn more.

    Reply
  • Nice one !

    Reply
  • Another useful and nice tip. Thanks!

    Reply
  • hi sir, but it did not work with me. i am using SQL Server 2005 Enterprise. Guide me.

    Reply

Leave a Reply