Already Posted a solution...
Declare @v-2 varchar(100)
Declare @i int
Set @v-2 = '12~12~~1234~13~~12~3~~'
Select @i = Len(@v) - Len(Replace(@v,'~',''))
Select @i
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
Sometimes, winning is not an issue but trying.
You can check my BLOG [font="Arial Black"]
here[/font][/url][/right]