Count number of occurences of a character in SQL string value?

sql, sql-server-2008

Solution

select len('you.late.you@asdf.com') - len(replace('you.late.you@asdf.com', '.', ''))

Problem

If you have the e-mail address ``` you.late.you@asdf.com you_late_you@asdf.com ``` How are you enable to count if you have 2 dots/underscore by using sql code?

Original source