T-SQL function to de-duplicate lists

Needed a function to de-duplicate string lists, so I modified a similar UDF from SQLAuthority. That original UDF didn’t preserve the position of list elements or handle case sensitive comparisons, and I wasn’t too keen on the variable naming. Anyway, my...