SQLTeam.com | Weblogs | Forums

Parentheses Matching in SSMS 2012


We recently went to SSMS 2012 (I was using SSMS 2008). It's driving me crazy figuring out how to set the parentheses matching. Is there a TOOLS/OPTIONS feature that can be set? I would think this would be not only a common functionality but almost necessary ! (Automatic matching of syntax pairs gives you immediate feedback on whether syntax elements that must be coded in pairs are correctly paired.)

I do have IntelliSense enabled in TOOLS/OPTIONS but when I click the toolbar "Query"...it shows greyed out.


My initial thought is that you are using too many parentheses ... I rarely use them nested deeply enough that I can't just see the levels.

Lots of code generators stick them in everywhere, unnecessarily, just to avoid having to figure out if they are needed or not! and such Write-Only-Code is a PITA to read, so if that is your problem? I suggest you remove all non-essential parentheses.

I don't write code in SSMS so I'm the wrong person to ask, but doesn't Intellisense look after Open/Close Parenthesis matching?


I don't have "too many" parentheses.... this functionality worked in SSMS 2008. But apparently, I am not familiar with what needs to be changed in SSMS 2012 to make it work.


Sorry, I'm not familiar with SSMS either, but hopefully someone who knows the answer will be along shortly :slightly_smiling:


So what do you use. I just switched to SSMS from QA (from SQL Server 2000 era) when my new laptop is Windows 10. Just can't get it install under Windows 10. :frowning:

SQL Editor IDE to use instead of Query Analyzer?

Hi mwdallas,

If u want select T-SQL code between two parentheses means put the cursor at the position displayed and pressed CTRL+SHIFT+] and it has selected the code between two corresponding parentheses.



That will need Intellisense running (which I think the O/P is having difficulty with? "when I click the toolbar "Query"...it shows greyed out.")


Yes, still QA here (and not yet Windows 10 :slight_smile: ). I'll start a new thread to discuss choices

EDIT: New thread:


UPDATE: We are going to a new server. I found out that while I'm on the OLD server using SSMS 2012 the IntelliSense won't work. I needed to see that the destination server is running an appropriate version of SQL Server because "IntelliSense does not function against SQL Server 2005 or previous versions". Problem solved. We should be using the new server next week, so we'll see.

Thanks all for your input in the interim.


How annoying :frowning: Glad you have a solution coming, sounds expensive though!


Just installed shiny new computer with Windows 10 and I have got QA working - in case helpful to you?

I had to download this DLL


and copy the file to

C:\Program Files\Microsoft SQL Server\80\Tools\Binn

folder (where my ISQLW.EXE file lives) [there was no pre-existing file of that name to overwrite, in that folder]

I read of suggestions to replace the existing file in SYSTEM32 (or SysWOW64 on 64-bit systems) - the file should already exist - but I couldn't overwrite the existing file in SysWOW64, it wanted permission that I could not provide :frowning:


Thanks. I will give it a try:slight_smile:


Syntax highlighting didn't work, this seemed to fix it:

Note: Need to open command prompt in Administrator Mode (referred to as "Elevated mode" I believe)

%windir%\SysWoW64\regsvr32.exe "C:\Program Files (x86)\Microsoft SQL Server\80\Tools\Binn\sqllex.dll"


Discovered today that this

SELECT 'xxx' AS [xxx xxx]] {xxx} xxx]
SELECT 'xxx' AS []]{}]

gives “Syntax error or access violation” in Query Analyser. its the specific sequence of double-close-square-bracket and open and then close curly-bracket. Take any of those out and it works OK, as does changing the order, so this works OK:

SELECT 'xxx' AS [{}]]]

There is no problem with these in SSMS so I reckon it is a bug in QA parsing ... just mentioning it here for any really old codgers ... like me!! ... who might still be using that antique.

The “Syntax error or access violation” has NO line number, so in a long block of code its hard to find the culprit. I did a highlight of the first "half", executed that to check for that error message, and then used a binary-chop t narrow down where the culprit was.