Click here to Skip to main content
15,868,016 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi team,

while executing below query getting the
Quote:
'STRING_AGG' is not a recognized built-in function name.


AS my server has SQL server version 2016
and my dev mechine having SQL server 2017

Quote:
SELECT distinct n.ID,n.brandName,n.requestType,
n.services,dm.department as department,aos.levelName as level,
STRING_AGG(pu.firstName+' '+pu.lastName,',') as fullName FROM Notification n
INNER JOIN DepartmentMaster dm on dm.departmentID=n.department
INNER JOIN NotificationUser nu ON n.ID=nu.fk_notification_id
INNER JOIN ProfileUser pu ON pu.userID=nu.userID
INNER JOIN AopLevel aos on aos.levelID=n.level where n.ID=nu.fk_notification_id group by n.ID,
n.brandName,n.requestType,n.services,dm.department,aos.levelName

Please advise how to resolve the error

What I have tried:

Quote:
On production I have SQL Server 2016 running and had to work on alternative for STRING_AGG which is not supported on older version
Posted
Updated 20-Feb-22 22:15pm

1 solution

 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900