Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
ppuar
Starting Member
28 Posts |
Posted - 2003-01-02 : 16:04:55
|
Problem: I am using xp_readmail to read in an xml document that is emailed to my sql mapi account. I would like to store the message into some kind of text type variable. However, SQL 2k does not allow ntext varibles to be local. Does someone know a good work around?Thanks Pardeep |
|
X002548
Not Just a Number
15586 Posts |
Posted - 2003-01-02 : 16:42:20
|
How about creating a permanent tableCreate table TABLE1 (xp_readmail column definitions)Then doInsert Into TABLE1 (Columns....) EXEC xp_readmail Columns need to be defined as the result of eXentded s/p. Look at books online, but here's the result set:Result Setsxp_readmail returns a result set with these columns (older messages appear first).Column name Description Originator Sender of e-mail message Date Received Date the e-mail message was received Recipients The people to whom the message was sent CC List The people on the CC'd line of the e-mail message BCC List The people on the BCC'd line of the e-mail message Subject Subject line of the e-mail message Message Message body (text) Unread Whether this message is unread Attachments Any attachments for the message Message ID Message ID Type Message type |
 |
|
ppuar
Starting Member
28 Posts |
Posted - 2003-01-02 : 17:50:53
|
xp_readmail does not output anything to message windows of sql query analyzer. If this not happen, how are the values going to get into the table?Pardeep |
 |
|
ppuar
Starting Member
28 Posts |
Posted - 2003-01-02 : 18:11:07
|
Ok I figured it out Now how do I take the message and pass it into sp_xml_preparedocument?This is what I am trying, but not working:EXEC sp_xml_preparedocument @idoc OUTPUT, (select message from #xmldocument)Pardeep |
 |
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2003-01-02 : 18:30:37
|
There's some code in Ken Henderson'sThe Guru's Guide to SQL Server Stored Procedures, XML, and HTMLThat does exactly what you need. And it's chock full of other incredibly useful stuff that will completely blow your mind. |
 |
|
ppuar
Starting Member
28 Posts |
Posted - 2003-01-02 : 18:35:04
|
Is this a book? |
 |
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2003-01-02 : 19:26:02
|
Yes. Take a look in the SQL Team Bookstore for more information. |
 |
|
|
|
|