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

How to count # of occurrences of a character inside a string?

$
0
0

I have a string of characters in my data flow and I need to add a derived column showing the # of times a certain character appears within that string.  For example, my string in the data flow is:

 

NNNNNRJKSURNNNEJNNNN

 

Now I need to count the number of "N"s in that column.  From the example above, I should get the integer 12, and that would be the value of my derived column.  Any ideas?


Viewing all articles
Browse latest Browse all 24688

Trending Articles



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