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 8558163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:44:51+00:00 2026-06-11T15:44:51+00:00

I have created a system that sends some information by SMS daily to our

  • 0

I have created a system that sends some information by SMS daily to our customers. as the procedure of sending SMS can take a while this is done by multiple processes that each process sends a limited number of SMSs. when a Process reads a number of records of pohne nubers (lets say 1000 of them) to send sms. I want to mark these 1000 records that the other process wouldn’t read these records too.

Select Top(1000) ID, Number from Phones where isactive = 1 and isverified = 1

I need some code that does something like this:

update Phones, set ReadTime = getdate() where (selected above)

now I want to update the column ReadTime of these records to getdate() to make sure that other schduled processes won’t read them again (the reason i’m setting a datetime flag instead of a Bit flag is that some SMS sending might fail and this way I can understand which ones are read long ago but not updated the sent time)

marking them after sending the sms (that should be done anyway to write sent time) wouldn’t help as the the scheduled taks that will process the sending SMSs will read all 1000 records at once and there might be records that are read by other processes but not flaged yet (as the SMS hasn’t been sent yet).

  • 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-11T15:44:52+00:00Added an answer on June 11, 2026 at 3:44 pm

    You should be able to do something like this:

    UPDATE Phones
    SET ReadTime = GetDate()
    WHERE ID IN (SELECT Top 1000 ID
                 FROM Phones
                 WHERE IsActive = 1
                     AND IsVerified = 1
                     AND ReadTime Is Null -- you will want to exclude any records already updated
                 ORDER BY ID) 
    

    see SQL Fiddle with Demo

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

Sidebar

Related Questions

I have created a newsletter system that allows me to specify which members should
On the class level, I have created reference: System::Data::Odbc::OdbcConnection Connection; in some method I
I have created an inbox system. Signed in user can message other signed in
I have a .net file that utilizes a c# to process some form(post) information,
So, here is the question. I have a small flash application that sends some
I have created a WCF service for uploading images , which accepts System.IO.Stream as
I am using the new System.Web.Optimization and have created a bundle like this: bundles.Add(New
i am creating a process using System.DIagnostics.Process in c# i have created a class
I'm developing a booking system in Rails 3.1. I have created a model for
Okay, so i have created a new support ticket system, but in my ticket

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.