Guys, how to remove spaces between rows with T-SQL?
<span class="p-title">Вес </span><span class="p-value"> 140</li> <li><span>Area di stampa </span>65</li> <li><span>Misura</span> 50</li> Вес ..."> Guys, how to remove spaces between rows with T-SQL? This code removes multiple spaces: More information about the algorithm can be found in this article. Important: the solution will remove multiple spaces and not damage the data strings, provided that the character - it is Source: https://ru.stackoverflow.com/questions/778425/<span class="p-title">Вес </span><span class="p-value"> 140</li> <li><span>Area di stampa </span>65</li> <li><span>Misura</span> 50</li> 1 answer
declare @string AS varchar(4000) SET @string = '<span class="p-title">Вес </span><span class="p-value"> 140</li> <li><span>Area di stampa </span>65</li> <li><span>Misura</span> 50</li>' SELECT @string SELECT REPLACE( REPLACE( REPLACE( LTRIM(RTRIM((@string))) ,' ',' '+CHAR(7) ) ,CHAR(7)+' ','') ,CHAR(7),'') AS ClearedString char(7) , will not appear in the data string. If it can be present in the string - you need to choose guaranteed unused and replace all occurrences of char(7) in the code with a new character.
All Articles