1

I like using notepad++ for my syntax editing because it can handle all the languages I work in.

However, when I load a TSQL script that uses SQLCMD stuff, it messes up the highlighting.

For example, if you have a sql file with this in it :setvar DefaultDataPath "D:\Data\" then everything after that will be light grey.

Is there a way to tell notepad++ to not do that?

1 Answer 1

1

It seems the issue here is coming from the \" at the end of your line. Notepad++ appears to be translating that as an escaped quote (") so it believes to still be in the same string.

I have not seen anything in Notepad++ that would automatically fix this for you (but to be honest I did not look too much into it). Some alternative options:

"D:\Data"
"D:\Data\""
"D:\Data\\"

I notice Notepad++ having these types of problems quite often but they are purely cosmetic issues.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.