I have the following string: \'BOB*\', how do I trim the * so it shows up as \'BOB\'
I tried the RTRIM(\'BOB*\',\'*\') but does not work as says needs only 1 paramet
@teejay solution is great. But the code below can be more understandable:
declare @X nvarchar(max)='BOB *' set @X=replace(@X,' ','^') set @X=replace(@X,'*',' ') set @X= ltrim(rtrim(@X)) set @X=replace(@X,'^',' ')