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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:25:08+00:00 2026-05-28T14:25:08+00:00

I have written a cursor: DECLARE CURSOR_SendMail CURSOR FAST_FORWARD FOR SELECT AlertId,AlertDetailsId,AlertDescription ,AlertTarget,ProjectDetailId,Subject FROM

  • 0

I have written a cursor:

DECLARE CURSOR_SendMail CURSOR FAST_FORWARD  
FOR  
SELECT AlertId,AlertDetailsId,AlertDescription  
,AlertTarget,ProjectDetailId,Subject  
FROM    tblAlert   
WHERE AlertId > @MaxAlertID

Here @MaxAlertID is some id so that records above that id will be mailed.

What I want to ask is:

While fetching records one-by-one and mailing them, will any new record inserted in tblAlert table also be considered or just the records that were available while declaring the cursor.

e.g.

At the time of declaring cursor max id present in table is 1000 and @MaxAlertID is 0.

So when I start sending mail for each record from 1 and above and I reach at some record 517 and a couple of records get added to tblAlert with 1001 and 1002, so those 1001,1002 will be considered or just up-to 1000 will be considered.

  • 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-05-28T14:25:09+00:00Added an answer on May 28, 2026 at 2:25 pm

    Look at the documentation for DECLARE CURSOR. There are options you can specify so that you get the behaviour you want – which you haven’t told us.

    If you don’t want to consider new records, consider specifying STATIC or KEYSET. If you do want to consider new records, specify DYNAMIC.

    I can’t actually remember what the default behaviour is – and can’t seem to find it at the moment. If I needed specific behaviour, I’d always specify it rather than rely on the default.

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

Sidebar

Related Questions

I have written method which should return string with data from select query, but
I have written the following code to set the cursor of a Gtk::Window from
I have written an AIR Application that downloads videos and documents from a server.
I have written a package that has a stored procedure and a REF cursor.
I have written a service To delete data from a table when data inputed
I have written an AJAX script to read information from a database and inject
I need to access child window elements from parent window. I have written the
I have written some thing like this to fetch data from the database. public
I have a cursor that queries a table like this CURSOR Cur IS SELECT
I have written some code in my VB.NET application to send an HTML e-mail

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.