简体   繁体   English

SQL Server内置函数名称

[英]SQL Server built-in function name

I'm trying to update sum columns data like this: 我正在尝试更新汇总列数据,如下所示:

update
   tableName
set
   score = myFunction(tableName.id)

In other hands I want to have a table like this: 换句话说,我想要一个这样的表:

column1   |     column2
------------------------------    
  id1     |  myFunction(id1)
  id2     |  myFunction(id2) 
  id3     |  myFunction(id3)
  id4     |  myFunction(id4)

I defined myFunction as a scalar-valued functions. 我将myFunction定义为标量值函数。 I also tried it as a table-valued function but I see this error in SQL Server 2012: 我也尝试将其作为表值函数使用,但在SQL Server 2012中看到此错误:

Msg 195, Level 15, State 10, Line 14 消息195,第15级,州立10,第14行
'myFunction' is not a recognized built-in function name. “ myFunction”不是公认的内置函数名称。

Please help me 请帮我

Try using the full name of the function, including the database and schema name: 尝试使用函数的全名,包括数据库和架构名称:

update
   tableName
set
   score = <database>.<schema>.myFunction(tableName.id)

I think only the schema name is needed, but I've gotten in the habit of putting both. 我认为只需要模式名称,但是我已经习惯了把两者都放。

The documentation explains that at least the two part name is needed. 文档说明至少需要两个部分的名称。 If you don't know what schema are, then the following will probably work: 如果您不知道什么是架构,那么以下方法可能会起作用:

update
   tableName
set
   score = dbo.myFunction(tableName.id)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 &#39;DateValue&#39;不是公认的内置函数名称Sql Server 2005 - 'DateValue' is not a recognized built-in function name Sql Server 2005 &#39;SESSION_CONTEXT&#39;不是公认的内置函数名称 - SQL Server - 'SESSION_CONTEXT' is not a recognized built-in function name - SQL Server “FORMAT”不是可识别的内置函数名称。 - SQL 服务器 - 'FORMAT' is not a recognized built-in function name. - SQL Server “EOMONTH”不是公认的内置函数名称 - SQL Server 2012 - 'EOMONTH' is not a recognized built-in function name- SQL Server 2012 SQL Server 2014,“格式”不是可识别的内置 function 名称 - SQL Server 2014, 'format' is not a recognized built-in function name &#39;PERCENT_RANK&#39;不是SQL Server中公认的内置函数名称 - 'PERCENT_RANK' is not a recognized built-in function name in SQL Server SQLSTATE [42000]:[Microsoft] [用于SQL Server的ODBC驱动程序11] [SQL Server]&#39;FIELD&#39;不是公认的内置函数名 - SQLSTATE[42000]: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]'FIELD' is not a recognized built-in function name Azure sql 服务器数据库和 MS Access - STRING_AGG 不是公认的内置 function 名称 - Azure sql server database and MS Access - STRING_AGG is not a recognised built-in function name SQL Server-查看表达式是否为内置函数的SQL - SQL Server - SQL to see if an expression is a built-in function 不是公认的内置函数名称 - is not a recognized built-in function name
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM