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.
| Author |
Topic |
|
aakcse
Aged Yak Warrior
570 Posts |
Posted - 2010-03-15 : 14:02:05
|
| Hi all,Can any one help me in writing a query in conuting the | char in a column.select charindex('|',colum1,1)... |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-03-15 : 14:03:55
|
| [code]select column,len(column)-len(replace(column,'|','')) as charcount from table[/code]------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
aakcse
Aged Yak Warrior
570 Posts |
Posted - 2010-03-15 : 14:37:54
|
| Hi Visakh it is not giving me the correct count for | char in a column |
 |
|
|
Sachin.Nand
2937 Posts |
Posted - 2010-03-15 : 14:41:33
|
Why?declare @str varchar(40)select @str='fg|sdf|00|fng|'select len(@str)-LEN(replace(@str,'|','')) PBUH |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-03-16 : 00:09:40
|
quote: Originally posted by aakcse Hi Visakh it is not giving me the correct count for | char in a column
first try it and see ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|