Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Find no of instances of charectar

Author  Topic 

jotmenow
Starting Member

12 Posts

Posted - 2006-09-13 : 19:09:51
Can any one help me in
finding the number of instance of a charectar in sqlserver.
is there any inbuilt function for this.

Thanks
Ajay

.

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-09-13 : 19:14:37
No. You can do something like this

to find the no of instance for 'a'

declare @str varchar(10)

select @str = 'abccdaa'

select len(@str) - len(replace(@str, 'a', ''))



KH

Go to Top of Page
   

- Advertisement -