Send mails at particular time in a batch process

  • Guys,

    I have to add member details in one object to send mails at particular time. So at particular system time, sql server will automatically send numbers of mails to members. Members could be in large numbers.

    So what is the best way to achieve that?

    Thanks in advance.

  • How large is 'large'? Do you want to do this internally (ie, using your own network/Exchange infrastructure), or use a third party (which you might, if large really is LARGE)?

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • One way is to create a job that has a schedule to run every x minutes, selects against your table where the row's date time matches the current date time AND where IsSent = 0, then do an sp_send_dbmail to actually send the notification.

    Tasks like this are typically implemented in the middle tier of a business application (c# for example) to offload the CPU, exchange integration, etc. from the expensive-to-scale SQL Server. Especially if you expect to send lots of emails all the time. However, the above ought to work just fine.

    Jim Murphy
    http://www.sqlwatchmen.com
    @SQLMurph

  • Hi,

    The link http://www.sql-server-performance.com/2006/email-functionality/ help me a lot.

    Thanks

  • There are above 50,000/ 1 Lac members. So do we need to create JOB and then schedule it? SO system will fire sp_send_dbmail from JOB?

  • Sagar Sawant (6/23/2011)


    There are above 50,000/ 1 Lac members. So do we need to create JOB and then schedule it? SO system will fire sp_send_dbmail from JOB?

    Yep.

    Jim Murphy
    http://www.sqlwatchmen.com
    @SQLMurph

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply