如何在 SQL Server 2008 R2 中使用 CONCAT 函数? [英] How do I use the CONCAT function in SQL Server 2008 R2?

查看:23
本文介绍了如何在 SQL Server 2008 R2 中使用 CONCAT 函数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 SQL Server 2008 R2 中寻找 CONCAT 函数.我找到了此功能的链接.但是当我使用这个函数时,它给出了以下错误:

I was looking for a CONCAT function in SQL Server 2008 R2. I found the link for this function. But when I use this function, it gives the following error:

消息 195,级别 15,状态 10,第 7 行
CONCAT"不是可识别的内置函数名称.

Msg 195, Level 15, State 10, Line 7
'CONCAT' is not a recognized built-in function name.

CONCAT 函数是否存在于 SQL Server 2008 R2 中?

Does the CONCAT function exists in SQL Server 2008 R2?

如果没有,如何在 SQL Server 2008 R2 中连接字符串?

If not, how do I concatenate strings in SQL Server 2008 R2?

推荐答案

CONCAT 是 SQL Server 2012 的新功能.您提供的链接清楚地说明了这一点,它不是上一个功能版本,包括 2008 R2.

CONCAT is new to SQL Server 2012. The link you gave makes this clear, it is not a function on Previous Versions, including 2008 R2.

可以在文档树中看到它是 SQL Server 2012 的一部分:

That it is part of SQL Server 2012 can be seen in the document tree:

SQL Server 2012  
Product Documentation  
Books Online for SQL Server 2012  
Database Engine  
  Transact-SQL Reference (Database Engine)  
    Built-in Functions (Transact-SQL)  
      String Functions (Transact-SQL)  

编辑 Martin Smith 帮助指出 SQL Server提供了 ODBC 的CONCAT 函数的实现.

EDIT Martin Smith helpfully points out that SQL Server provides an implementation of ODBC's CONCAT function.

这篇关于如何在 SQL Server 2008 R2 中使用 CONCAT 函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆