Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

unable to use STUFF, XML PATH sql functions

suchetadineshs
New Contributor
New Contributor
Hello,
 
We have a usecase where we want to update a user's custom property with the comma separated values.
 
For example
 
select name, accountkey from accounts where name = 'sjain2'
 
This query will give us 70 rows and now we want to have accountkey in the same column as comma sepatrated.
 
I tried the below query but it is giving some error, seems like saviynt doesn't support it.
 
select a.name, (Select STUFF((SELECT ',' + accountkey from accounts for XML PATH('')),1,1,'')) as key from accounts a where a.name = 'sjain2'
 
2 REPLIES 2

rushikeshvartak
All-Star
All-Star

This is MSSQL feature. You can use group_concat function. Can you give example how data is & how it should look like with sample example


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

jayasudha
Saviynt Employee
Saviynt Employee

Hi,

Could you please try this query.

SELECT name,GROUP_CONCAT(accountkey) FROM accounts where name="sjain2" GROUP BY name;

Thanks and regards,

Jayasudha R