1

I'm trying to figure out how to stop autocomplete suggestion of variable types while keeping the autocomplete suggestion for table and column names (so disabling autocomplete function is note the solution).

For example, if I type NVARCHAR, the autocomplete suggests nvarchar and once I continue typing, it automatically correct the word.

It is a convention of my company to write variable types uppercase and the autocomplete function transform them to lower case each time. I know i can hit "Esc" to avoid the correction, but do this each single time is something really annoying.

UPDATE: Actually the same problems happens when tiping for example IS:

CASE WHEN colName IS NULL

becomes

CASE WHEN colName IS_CALLERSIGNED NULL

if i don't press esc

3
  • 1
    Not trying to interfare with your company policy but you should read this written by Aaron Bertrand. blogs.sentryone.com/aaronbertrand/… Commented Aug 3, 2017 at 11:30
  • @SqlWorldWide I've updated the question with a different situation
    – Mark
    Commented Aug 3, 2017 at 14:58
  • This has definitely changed and it is so damn annoying. "IS" for god sake along with "PARTITION" auto-completing to "PARTITION_FRAGMENT_ID", when I am adding aliases to tables...
    – RIanGillis
    Commented May 4, 2020 at 19:06

1 Answer 1

3

For example, if i type NVARCHAR, the autocomplete suggests nvarchar and once i continue typing, it automatically correct the word.

This autocompletion is not just a "convention", SQL Server types that you can see querying sys.types are all lowercase, and this is a good reason to use them ALWAYS lowercase:

if one day your code migrates to a server with case sensitive collation, no one of your UPPERCASE types will be recognized as system type.

So yours is not a good convention and I think you cannot change this at least in SSMS because they(MS) are aware of this possible issue.

You can look for some customizable code formatter in internet

3
  • Thanks, i didn't know about this. Anyway, when I was using SSMS 2016, this function wasn't replacing them. Does this mean that it is a new function?
    – Mark
    Commented Aug 3, 2017 at 12:40
  • I didn't try it out yet
    – sepupic
    Commented Aug 3, 2017 at 12:51
  • Ok, I've updated the question with a different situation anyway.
    – Mark
    Commented Aug 3, 2017 at 14:58

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.