home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.databases.ms-sqlserver      Notorious Rube Goldberg contraption      19,505 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 17,624 of 19,505   
   Ed Murphy to Dave Clarke   
   Re: PATINDEX in Compact Edition   
   25 Aug 09 06:06:43   
   
   6d63d1c6   
   From: emurphy42@socal.rr.com   
      
   Dave Clarke wrote:   
      
   > 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.   
      
   case   
     when Address1 like   '[^0-9 ]%' then 1   
     when Address1 like  '_[^0-9 ]%' then 2   
     when Address1 like '__[^0-9 ]%' then 3   
     -- extend this pattern as far as needed in practice   
   end   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca