Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8840425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:27:44+00:00 2026-06-14T10:27:44+00:00

I have the need to identify records in my database that contain a phone

  • 0

I have the need to identify records in my database that contain a phone number so that I can send them on to a contact team.

Example:
tblData

  • id
  • comment
  • dtCreate

Given this table structure, the query might be:

SELECT * FROM tblData WHERE comment [HeresWhereINeedHelp]

The comment might (and likely will) contain all sorts of other data. An example comment:

Yea, I had a terrible experience. I’d like for someone to call me at 111.222.3333. Thank you.

The record containing this comment should be pulled in the query because it contains a phone number.

I tried an extended SPROC that enabled regex searching, but the performance was terrible. The system is SQL Server 2012.

Many thanks for any direction.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T10:27:45+00:00Added an answer on June 14, 2026 at 10:27 am

    You should look at the LIKE operator. In your case, you’re probably going to go for something along the lines of

    WHERE comment LIKE '%[0-9][0-9][0-9]_[0-9][0-9][0-9]_[0-9][0-9][0-9][0-9]%'
    

    Since you’re searching anywhere in the string, this will also take a long time to process over a large dataset – another option you might want to try is checking the comment field for a phone number when it’s entered and then flagging that row using a column like ContainsPhoneNumber (bit). That way, you can index on that column and do faster lookups.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to process a big data file that contains multi-line records, example input:
I have a need to identify comments in different kinds of source files in
I have need for a function pointer that takes two arguments and returns a
I have a need for two slightly different classes, that have the same members,
I have a script that processes queued records in a SQL table in SQL
I'm dealing with a legacy system where I need to identify some bad records
I have a database full of classified adverts for computers for sale that have
I have got a datatable with records from two different database tables. Each of
I need to have users that update/insert information logged correctly. Currently the connection string
I have an ASP.NET web form application that on the server side I need

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.