Click here to Skip to main content
15,940,430 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:

I would like to edit SQL in Visual Studio with all the nice syntax colouring but I don't want it to try being too clever, trying to access the database etc.

I thought one way to do this might be to create my own file type (say .sqlt). If I do nothing, this will simply be treated as a text file, which means no colouring. Is there a way I can get VS to colour it as if it were a .sql file?

I have looked at articles for setting up colouring for custom file types in VS and cannot believe how much work is involved. In most other text editors I have used, you can easily create a custom type just be creating a config file, containing the keywords, operators, etc. It takes ten minutes. Why does VS have to make such a simple thing so damned complicated?

(Note: I am not bothered about auto-completion/Intellisense).

Kind wishes ~ Patrick
Sergey Alexandrovich Kryukov 24-Mar-14 11:32am    
There is nothing simple here. Isn't it obvious?
joshrduncan2012 24-Mar-14 12:09pm    
*thumbs up*
Sergey Alexandrovich Kryukov 24-Mar-14 12:21pm    
Thank you. :-)
Patrick Skelton 24-Mar-14 12:35pm    
I don't understand.

1 solution

Please ignore Sergey's answer he was trying to be smart and failed.

Yes you can control the keyword recognition and colourization which is held in a user data file called Usertype.dat which you will find in "C:\Program Files\Microsoft Visual Studio 11.0\Common7\IDE" for 32 bit versions of windows or "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE" for 64 bit versions of windows.

You can open and edit the file with any simple text editor like notepad or wordpad.

Kip Irvine has for example done a full blog on how to modify VS 2012 to deal with ASM files in VS 2012 which you might find helpful[^]

That includes setting up call the external program directly from within VS 2012 which might also interest you.
Share this answer
Patrick Skelton 25-Mar-14 6:21am    
That's excellent - thank you.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900