Reputation: 365
In SSMS, given the following statement,
Why is the word UID highlighted as a keyword?
Secondly, what is UID (or uid)?
Does it relate to GUIDs or User IDs or ...?
According to this answer and SQL Servers latest T-SQL reserve keyword documentation, it's not a reserved keyword. So why is it highlighted in blue?
And in case your wondering why there's no red syntax error highlighting beneath the word UID, like so:
... in the the first image above, it's because I'm selecting an existing column named "UID" from a table in a 3rd-party SQL Server database, whose architect(s) chose to name all tables' primary key columns "UID".
Upvotes: 4
Views: 710
Reputation: 593
I believe it's because it's a valid SQL Server login account. Bit of info here: https://learn.microsoft.com/en-us/sql/relational-databases/native-client/applications/using-connection-string-keywords-with-sql-server-native-client?view=sql-server-ver15
I also found where this UID is a keyword (confirmed in my SSRS Tools>Options>Environment>Fonts and Colors>Display items: Keyword) referencing server user id: https://learn.microsoft.com/en-us/sql/odbc/reference/develop-app/driver-specific-connection-information?view=sql-server-ver15
Upvotes: 1
Reputation: 175596
At least for Azure Data Studio(which is a newer product than SSMS):
sql.tmLanguage.json: uid is under section "name": "keyword.other.sql"
The provided list is much broader than the one available at: Reserved Keywords (Transact-SQL) and contains values like: lineage_80_to_100
, kilobytes_per_batch
, ...
Upvotes: 3