Question

I am using SQL Server Management Studio 2012 and am trying to update the Fonts and Colors using my Visual Studio dark theme settings and in doing so, I've found something a bit weird:

UPDATE is being colored with the color assigned to the SQL System Function display item.

SELECT, INSERT, and DELETE all are colored with the color assigned to the Keyword display item.

So the question is, why is the Keyword UPDATE being considered as if it were a SQL System Function?


UPDATE

I have noticed that this same issue also occurs in Visual Studio with the 2012 version of the SQL Server Data Tools installed. This may also be an Intellisense bug.

I have reported this as a bug at Microsoft Connect under SQL Server.

Was it helpful?

Solution

Because it is also a Trigger function, you can use it like UPDATE(ColumnName) and this will return true or false if you updated that coulmn.

MSDN Update Function()

Returns a Boolean value that indicates whether an INSERT or UPDATE attempt was made on a specified column of a table or view. UPDATE() is used anywhere inside the body of a Transact-SQL INSERT or UPDATE trigger to test whether the trigger should execute certain actions.

Microsoft's Official Response (link):

Hello Scott. Because of the ambiguity of how UPDATE can be used, it will sometimes appear to be the correct color and sometimes not. This behavior is known and by design. Thank you for you feedback.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top