microsoft:microsoft_sql_server:sql:format:convert_multiple_and_duplicate_spaces_to_single_space
This is an old revision of the document!
Microsoft - Microsoft SQL Server - SQL - Format - Convert Multiple and Duplicate Spaces to Single Space
WHILE loop and REPLACE
SQL QUERY
DECLARE @TestString VARCHAR(200); SET @TestString=' Ex ample St ring '; WHILE CHARINDEX(' ',@TestString) <> 0 SET @TestString = REPLACE(@TestString,' ',' '); SELECT @TestString AS RESULT;
microsoft/microsoft_sql_server/sql/format/convert_multiple_and_duplicate_spaces_to_single_space.1628172482.txt.gz · Last modified: 2021/08/05 14:08 by peter