I have now this (1 record) result:
;Admins;Sales;SalesAdmin;Other;Sales;Admins;All users;
Now, as you can see, there are some double rolenames.
I see admins and Sales 2 times between ";".
Is there a way to filter that out?
So that this will be the result:
;SalesAdmin;Other;Sales;Admins;All users;
Thanks!Concatenate the result set into one ";"-delimited string
parse the string and put each value into a table variable where the value doesn't already exist
Use this to create a string out of the values in your table variable
sqldeclare @.s varchar(8000)
select @.s = value + '; ' + COALESCE(@.s, '')
from @.tableif @.s is not null
set @.s = substring(@.s, 1, LEN(@.s) - 1)
else
set @.s = ''return (left(@.s, 2000))
No comments:
Post a Comment