Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2004
    Location
    Montreal, Canada
    Posts
    151

    Unanswered: Check and send data with xp_sendmail

    How yould i loop trought all the records in a table and fetching a specic record that is flagged and sending for each record found a email with that records data to a mail recipient. this should be part of a step in a sql job. PLZ HELP

  2. #2
    Join Date
    Jan 2004
    Location
    Boston
    Posts
    58
    Had a little problem in understanding your phrases. You may check cursor in BOL for looping actions.

  3. #3
    Join Date
    Jul 2003
    Location
    The Dark Planet
    Posts
    1,401
    create proc abc as
    declare c1 cursor as select primary key from table name where condition
    open c1
    while (@@fetch_status =0)

    begin
    exec xp_sendmail .....
    fetch next
    end




    something like this and schedule as job !!!
    Get yourself a copy of the The Holy Book

    order has no physical Brett in The meaning of a Kaiser . -database data

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •