How are you getting the comma-delimited
string in SP?
Is it passed as input param or fetched from some table or built by appending comma in for loop over some data?
1. If it is passed as input param, this can be done before calling the SP.
2. If it is fetched from table, it can be done by first converting the comma delimited string into multiple rows and applying a DISTINCT on those rows. (Hint: Use regex).
3. If it is built by iteration, it can be done at the time of iteration only.