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 2012 Forums
 Transact-SQL (2012)
 REGEXP_REPLACE in SQL server 2012

Author  Topic 

april24
Starting Member

5 Posts

Posted - 2015-03-06 : 03:13:59
Hello,

Please suggest how can I convert following PLSQL code

count:= length(regexp_replace(data,'[^,]'))

to T-SQL?
Thanks.

robvolk
Most Valuable Yak

15732 Posts

Posted - 2015-03-06 : 07:11:12
I can't test this (no Oracle) but it should be equivalent:
SELECT LEN(data)-LEN(REPLACE(data,',',''))
Go to Top of Page
   

- Advertisement -