SQL Server Performance

How to store email in database?

Discussion in 'General DBA Questions' started by artfuldodger, May 24, 2005.

  1. artfuldodger New Member

    Is there a way to store email in a database table?

    Also, how do I enable email to be sent from SQL Server?

    Thanks.
  2. dineshasanka Moderator

    Answering to ur second question first
    http://www.databasejournal.com/features/mssql/article.php/3489111
    http://www.emailarchitect.net/webapp/smtpcom/developers/sqlemail.asp
    to save the emails to sql server tables,
    need some information, do you want to save the email which are recived to your out look. there are ways you can read your outlook, you can get teh details of sender , recevier which you can save them in a varcahr field which ou can save the sent or received datetime in datetime filed. you can save the body in a text field.


    quote:Originally posted by artfuldodger

    Is there a way to store email in a database table?

    Also, how do I enable email to be sent from SQL Server?

    Thanks.
  3. artfuldodger New Member

    I think what I need for sending mail is really like an alert if something is wrong or scheduled?

  4. FrankKalis Moderator

    I started by storing E-Mails (yes, that's the official (ridiculous) German writing by taking this complex data type into its pieces and storing this pieces in separate columns. This works fine as long as you don't need to put the pieces back together again.
    I changed it now to store one single BLOB object in an IMAGE column. I use this here from within Outlook to store mails in Outlook's *.msg format. The advantage here is, you don't need to care about how to open it. So, depending on what you want to do, I would suggest one single IMAGE column. The actual storing and retrieving is pretty easy when you use ADO and its stream object. Have a look here:
    http://www.microsoft.com/resources/documentation/sql/2000/all/reskit/en-us/part3/c1161.mspx

    --
    Frank Kalis
    SQL Server MVP
    http://www.insidesql.de
  5. artfuldodger New Member

    Thanks Frank.

    That seems to be what I need for storing the email.

    Is there anything I need to do to enable SQL Server to send email alerts, etc?
  6. FrankKalis Moderator

Share This Page