Results 1 to 4 of 4
  1. #1
    Join Date
    May 2004
    Posts
    9

    Unanswered: xp_readmail truncates message

    I am using (or trying to) xp_readmail to import email into a table for further processing. I am using the following line to bring the email into a table (this is part of a larger stored procedure):

    insert email_import exec master.dbo.xp_readmail

    However, the email message is always truncated at 250 characters.

    BOL says:

    [@message =] 'message' Is the returned body or the actual text of the mail message. message is text, with no default.

    I am at a loss here and I really need to get the entire message body into the imprt table so that I can parse the subject line to identify the row in the destination table to update with the email message body. Anybody have any ideas?? Thanks...

  2. #2
    Join Date
    Apr 2004
    Location
    Kansas City, MO
    Posts
    734
    Give us the sample CREATE TABLE and EXEC statement. Is the column a text column?
    MeanOldDBA
    derrickleggett@hotmail.com
    When life gives you a lemon, fire the DBA.

  3. #3
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Quote Originally Posted by simpsonjd
    However, the email message is always truncated at 250 characters.
    It isn't truncated, although I can see why you'd think that it was.

    The problem is that the value being displayed is truncated at 250 characters... With Query Analyzer, what you see isn't always what you get! If you adjust the column width (Shift-Ctrl-o, click the results tab, near the middle) to more than 250 characters, you can see more! As a word of warning, this is generally a "bad thing", because it means that Query Analyzer needs to allow for the widest possible column every time it allocates memory, and increasing this value very quickly leads to paging when you retrieve large result sets.

    Once you are "warm and fuzzy" that you are getting the data you want, reset your maximum column width back to something managable (I like 100 characters), then think about how you want to manipulate your data instead of being worried about where it all went!

    -PatP

  4. #4
    Join Date
    Apr 2004
    Location
    Kansas City, MO
    Posts
    734
    DUH!!

    It's good to be able to laugh at yourself.
    MeanOldDBA
    derrickleggett@hotmail.com
    When life gives you a lemon, fire the DBA.

Posting Permissions

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