I have a database column and its give a string like ,Recovery, Pump Exchange,.
,Recovery, Pump Exchange,
I want remove first and last comma from string.
Expected Result :
Try like this:
if(Substring(@mykeyword, 1,1) = ',' and Substring(@mykeyword, LEN(@mykeyword) - 1, LEN(@mykeyword))=',') SET @mykeyword = Substring(@mykeyword, 2, LEN(@mykeyword) - 2)