SQL Server Msg 195, Level 15, State 10, Line 6 'String_Agg' is not a recognized built-in function name

lpwwtiir  于 2023-08-02  发布在  其他
关注(0)|答案(1)|浏览(365)

I am trying to execute string_Agg() function at below mentioned version.

But SQL Server throws this error:
Msg 195, Level 15, State 10, Line 6
'String_Agg' is not a recognized built-in function name

Versions used:

SQL Server Management Studio                    15.0.18131.0
Microsoft Analysis Services Client Tools        15.0.1347.0
Microsoft Data Access Components (MDAC)         10.0.14393.0
Microsoft MSXML                                 3.0 6.0 
Microsoft Internet Explorer                     9.11.14393.0
Microsoft .NET Framework                        4.0.30319.42000
Operating System                                10.0.14393

Please help for any workaround for this.

bf1o4zei

bf1o4zei1#

see the sql server version of the Target Sql Server, by running below command.

SELECT @@version

Or you can run below command to get information about Sql server

SELECT  
  SERVERPROPERTY('MachineName') AS ComputerName,
  SERVERPROPERTY('ServerName') AS InstanceName,  
  SERVERPROPERTY('Edition') AS Edition,
  SERVERPROPERTY('ProductVersion') AS ProductVersion,  
  SERVERPROPERTY('ProductLevel') AS ProductLevel;  
GO

if you see, STR_AGG() is supported only from SQL Server 2017(version 14.x) onwards.

相关问题