• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 724
  • Last Modified:

SQL Server Help - Is there an alternative to PatIndex

In MS SQL Server, is there an alternative to PatIndex?  I have the Select Query below which currenly uses the PatIndex function but is there another way this can be with a different function? The purpose of this query is to identify invalid chars in a column.


SELECT *
FROM [Addresses.txt]
WHERE PatIndex('%[^a-z0-9]%', [Addresses.txt].[PROD_CD]) > 2
0
hojohappy
Asked:
hojohappy
1 Solution
 
awking00Commented:
Can you supply some sample data for prod_cd and what you expect to return?
0
 
Scott PletcherSenior DBACommented:
I don't know of any other built-in function that duplicates what PATINDEX() does.  After all, why would there need to be two built-in functions that did the same thing?!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now