Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Query for non Alpha data
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Yak Posting Veteran

82 Posts

Posted - 06/28/2013 :  11:32:27  Show Profile  Reply with Quote
We have a field that has been adding "/" in it. I need to create a query that pulls anything thing that is not an alpha letter. How can I do that? I have never created anything like this before.

Select Distinct middleName from pro

Very Important crosS Applying yaK Herder

52326 Posts

Posted - 06/28/2013 :  11:34:32  Show Profile  Reply with Quote

SELECT middlename FROM pro WHERE Field LIKE '%[^A-Za-z]%'

SQL Server MVP
Go to Top of Page

Posting Yak Master

216 Posts

Posted - 07/01/2013 :  01:14:19  Show Profile  Visit sshelper's Homepage  Reply with Quote
Just in case there are spaces in the middle name or even periods (which may be valid since the user might have just entered a middle initial with a period), you can add those characters to the query provided by visakh16:

SELECT middlename FROM pro WHERE middlename LIKE '%[^A-Za-z .]%'

But if you just want to search for "/", you can do it this way:

SELECT middlename FROM pro WHERE middlename like '%/%'

SQL Server Helper
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000