SQL Querys Starts with letter only

Posted on 2012-09-06
Last Modified: 2012-09-27
Hi All

I have a database with over 2 million contacts, i need to remove a names that don't start with a letter we have a few thousand that start with number / symbols which obverly arent really how can build a query to delete these?  

Question by:Matb396
    LVL 68

    Accepted Solution

    You can do that, but are you SURE the data is really bad?

    Plenty of company names start with non-letters ... 1st Tennessee Bank, 3M, etc..

    That said, here's the DELETE you asked for:

    DELETE FROM dbo.tablename
        name LIKE '[^a-zA-z]%' --name doesn't start with a letter
    LVL 25

    Expert Comment

    by:Lee Savidge
    delete from mytable where left(mycol, 1) not like '[a-z]'
    LVL 25

    Expert Comment

    by:Lee Savidge
    Scott, I'm guessing the question asker is referring to contacts in terms of people.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Hi, In my previous Article  ( discussed some basic understanding of Microstrategy that how we can get in Intro of Microstrategy (MSTR). Now it's tim…
    How to increase the row limit in Jasper Server.
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    759 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

    11 Experts available now in Live!

    Get 1:1 Help Now