Replace the ASCII code for the tab (9):
replace(@str, char(9), '')
To remove only external tabs, first change them to something that will not exist in your data (in this example, I use a series of four spaces), then rtrim / ltrim, and then convert the same sequence back to tabs:
replace(ltrim(rtrim(replace(@str, char(9), ' '))),' ', char(9));
morgb source share