Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

Derived column transformation - removing embedded spaces

$
0
0

Hi,

After a few hours of fruitless searching I give uo and call upon the gurus ;)

I am trying to remove embedded spaces as part of a Derived column transformation for a name field, eg "Mr      Fred       Smith" should become "Mr Fred Smith", initially I thought REPLACE(Customer_Name,"  "," ") but of course that only reduces the number of occurences. The TSql equivalent would be:

While CHARINDEX('  ',Customer_Name) > 0
 set Customer_Name = REPLACE(Customer_Name,'  ',' ')

How do I iterate to replace ALL occurences aS a Derived column transformation?

Help most appreciated

Mark


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>