Discussion:
PATINDEX in Compact Edition
(too old to reply)
Dave Clarke
2009-08-24 23:24:58 UTC
Permalink
I've been trying to use PATINDEX in SQL Server CE and it isn't
behaving the way I would like it to. I'm trying to strip leading
characters from a street address to return a meaningful street name.

e.g. DISTINCT PATINDEX('%[^0-9, ]%', Address1)

For addresses like '123 Some Street' this works in SQL Server but not
in CE. I'm currently doing this processing using C# to get a list of
distinct streets and I was hoping to gain some speedup by getting the
database to do the heavy lifting. Any suggestions re alternative
approaches would be much appreciated.
ErikEJ
2009-08-31 08:18:56 UTC
Permalink
Sadly, SQL Compact T-SQL does not support regular expressions. Maybe you
should redesign the way data is stored?
--
Erik Ejlskov Jensen, Mobile App Dev MCTS
Check out my SQL Compact blog at
http://erikej.blogspot.com
Post by Dave Clarke
I've been trying to use PATINDEX in SQL Server CE and it isn't
behaving the way I would like it to. I'm trying to strip leading
characters from a street address to return a meaningful street name.
e.g. DISTINCT PATINDEX('%[^0-9, ]%', Address1)
For addresses like '123 Some Street' this works in SQL Server but not
in CE. I'm currently doing this processing using C# to get a list of
distinct streets and I was hoping to gain some speedup by getting the
database to do the heavy lifting. Any suggestions re alternative
approaches would be much appreciated.
Loading...