none
Why is 'Population' treated as a keyword in SSMS? RRS feed

  • Question

  • Our team noticed that SSMS identifies 'population' as a SQL keyword but it's not listed in the Reserved Keywords or Future Keywords.  Is this a defect in SSMS (v17.9.1) or an omission from the docs?

    Kind Regards

     
    Friday, August 16, 2019 4:58 PM

Answers

  • There are many unreserved keywords in T-SQL. That is, words that serve as keywords in particular contexts, but still can be used as identifiers. SSMS tends to show these as keywords in syntax colouring, but since the colouring is made without any context, there can be false positives.

    I googled on T-SQL and POPULATION and I landed about a page about full-text indexing, and there is a indeed a POPULATION clause in the command CREATE FULLTEXT INDEX. You can find examples here:
    https://docs.microsoft.com/en-us/sql/relational-databases/search/populate-full-text-indexes?view=sql-server-2017

    Interesting enough, POPULATION is not coloured in those examples...


    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

    • Proposed as answer by Olaf HelperMVP Saturday, August 17, 2019 5:25 AM
    • Marked as answer by Rusty Swayne Monday, August 19, 2019 3:26 PM
    Friday, August 16, 2019 9:00 PM

All replies

  • There are many unreserved keywords in T-SQL. That is, words that serve as keywords in particular contexts, but still can be used as identifiers. SSMS tends to show these as keywords in syntax colouring, but since the colouring is made without any context, there can be false positives.

    I googled on T-SQL and POPULATION and I landed about a page about full-text indexing, and there is a indeed a POPULATION clause in the command CREATE FULLTEXT INDEX. You can find examples here:
    https://docs.microsoft.com/en-us/sql/relational-databases/search/populate-full-text-indexes?view=sql-server-2017

    Interesting enough, POPULATION is not coloured in those examples...


    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

    • Proposed as answer by Olaf HelperMVP Saturday, August 17, 2019 5:25 AM
    • Marked as answer by Rusty Swayne Monday, August 19, 2019 3:26 PM
    Friday, August 16, 2019 9:00 PM
  • Hi Rusty Swayne,

    Did you resolve your issue? If you have resolved your issue, please mark the useful reply as answer. This can be beneficial to other community members reading the thread.
    In addition, if you have another questions, please feel free to ask.
    Thanks for your contribution.

    Best regards,
    Cathy Ji

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to  MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Monday, August 19, 2019 8:49 AM