Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789

    Question Unanswered: stored procedure

    I want to create a stored procedure or trigger in sql server to email everyone certain people in my department reports once a month? I'm still learning sql and I was wondering how I would go about doing this??

    thank you

  2. #2
    Join Date
    Apr 2004
    Location
    Kansas City, MO
    Posts
    734
    Look up xp_sendmail in Books Online.
    MeanOldDBA
    derrickleggett@hotmail.com
    When life gives you a lemon, fire the DBA.

  3. #3
    Join Date
    Feb 2004
    Location
    Burbank & Santa Cruz de la Sierra
    Posts
    3,716
    Yeah, I do the same thing in several of my databases through a stored procedure that notifies folks in the dept if any errors occur in logical database stuff.

    One thing I am finding is that apparently there is some administration-level stuff that has to be done on the server to allow the xp_sendmail to work...on some of my servers it works just fine, but on one in particular case, even after calling xp_sendmail and getting the "mail sent" message, it falls into a bit bucket somewhere on the way out. I had a developer tell me on his way out of the company a while back that this is because "the server admin will have to add support for sendmail on it" *scratching head*
    aka "Paul"
    Non est ei similis.

    I just read "100 Things To Do Before You Die". I was surprised that "Yell for help!!" wasn't one of them

  4. #4
    Join Date
    Feb 2004
    Location
    Burbank & Santa Cruz de la Sierra
    Posts
    3,716
    Ahhhhh...read and ye shall learn :blush:
    The computer running SQL Server must be set up as an e-mail client. SQL Server Enterprise Manager is used to assign an e-mail account and password to the SQL Server installation. The mail component of SQL Server can then be enabled to start automatically when the SQL Server Agent service is started. Alternatively, the mail component can be started and stopped at will using either SQL Server Enterprise Manager, or the xp_startmail, xp_stopmail, and xp_sendmail stored procedures.
    aka "Paul"
    Non est ei similis.

    I just read "100 Things To Do Before You Die". I was surprised that "Yell for help!!" wasn't one of them

Posting Permissions

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