SQL 语句 "Update"SQL Server 2014 中的颜色

标签 sql sql-server sql-server-2008 sql-server-2014

当我们使用SQL Server 2008写SQL语句时使用关键字update ,它在 blue 中着色:

enter image description here

但是当我们在 SQL Server 2014 中编写相同的 SQL 时,它在 magenta 中:

enter image description here

正如我们所知,SQL Server 中的洋红色通常不是用于关键字,而是用于 built-int functions , 或 datepart (和其他一些):

enter image description here

(在上面的例子中, Datenamegetdate 是内置的 functionsdayweekdatepart )

但是select , create , insert , 和 delete关键字都是一致的 blue在 SQL Server 中:

enter image description here

这种变化背后的原因是什么(现在是 updatefunction)?有什么办法可以改变update颜色返回 blue在 SQL Server 2014 中?

最佳答案

它是一个触发器函数,您可以像 UPDATE(ColumnName) 一样使用它,如果您更新了该函数,它将返回 true 或 false。

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.

关于SQL 语句 "Update"SQL Server 2014 中的颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35881906/

相关文章:

mysql查询第二个单词以字母开头

sql - 计算分级定价的总和。 SQL 服务器。等级定价表

c# - Windows 服务 SQL Server 错误 - "Login failed for user"

c# - 如何设置SqlDependency来监控多个表

php - 产品网格中的自定义 SQL

mysql - sql数据库-将字段重置为自动递增

sql-server - 实现 MFA 后管道失败

sql - 如何创建根据特定设置访问不同表的 "materialized something"

sql - 将 SQL 表中的行输出到一个带有逗号的字段中

sql - 添加伪列以使用连接查询进行选择,指示连接来自的表名