Is there a way to declare a list of items in an sql server stored procedure using T-SQL and then loop through the items?
I'm trying to do something like this:
input_string = 'my dog has fleas.'
list_remove = 'a', 'e', 'i', 'o', 'u'
for each item in list remove
input_string = replace(input_string, item, '')
end
And in the end input_string would be 'my dg hs fls.'
I know we can create a table in a stored procedure. Is that the best way to do something like this?