Solved

SQL Server Help - Is there an alternative to PatIndex

Posted on 2013-05-28
2
582 Views
Last Modified: 2013-06-14
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
Comment
Question by:hojohappy
2 Comments
 
LVL 31

Expert Comment

by:awking00
ID: 39202440
Can you supply some sample data for prod_cd and what you expect to return?
0
 
LVL 69

Accepted Solution

by:
ScottPletcher earned 500 total points
ID: 39202513
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Introduced in Microsoft SQL Server 2005, the Copy Database Wizard (http://msdn.microsoft.com/en-us/library/ms188664.aspx) is useful in copying databases and associated objects between SQL instances; therefore, it is a good migration and upgrade tool…
Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now