In SSMS, are IntelliSense and SQLCMD mode mutually exclusive?

Is there any way to make IntelliSense work when SQLCMD mode is enabled? (I use SQLCMD a lot)

I'm trying to understand why IntelliSense becomes disabled in SQLCMD mode, but there's so much information for both of them in Google search results that I can't find an obvious answer.

I found this good discussion about it, but not really an answer to my question.

2 Answers 2


Enabling the "TSQL" XEvent Profiler session allows us to see when the Intellisense cache is refreshed.

When running in SQLCMD mode, SSMS doesn't even attempt to obtain the Intellisense data.

If you disable SQLCMD mode via the menu on a session that is already connected, while the TSQL XEvent Profiler is running, you'll see SSMS query the system schema for the relevant info.

Since SQLCMD mode can be used to connect to a different instance, having accurate information for Intellisense would be difficult to guarantee, which is likely why Microsoft has it turned off.

  • Ahhh I think I understand now. Because SQLCMD is a much larger sandbox with access to many resources, Intellisense wouldn't know what data to access or display?
    – spinjector
    Commented Sep 1, 2021 at 18:28
  • precisely correct
    – Hannah Vernon
    Commented Sep 1, 2021 at 18:32

This article states that intellisense is turned off when in SQLCMD mode.


Doesnt really answer why, but since this seems pretty absolute it would indicate there is no way to enable it in sqlcmd mode. My hunch is that intellisense is an SSMS function and sqlcmd mode is effectively like going to command line. Same behaviour in Azure Data Studio.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.