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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 I use xp_readmail, but can not get the long message text only short one

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2003-07-04 : 08:36:20
blueskybird writes "I try to use xp_readmail to read through the message, but I use the code your sqlguru given:

DECLARE @hMessage varchar(255), @MessageText varchar(1000)

EXEC xp_findnextmsg @msg_id=@hMessage OUT
WHILE @hMessage IS NOT NULL
BEGIN
exec xp_readmail @msg_id=@hMessage, @message=@MessageText OUT
SELECT 'You''ve got mail! Here it is: ' + @MessageText
EXEC xp_findnextmsg @msg_id=@hMessage OUT
END


only can get short message like "
Welcome to Microsoft Outlook 2000 One Window to Your World of Information Microsoft(R) Outlook(R) 2000 is the premier messaging and collaboration client that helps you achieve better results by combining the leading suppor"

but I want to get the whole message longer than 1000 characters, can we do that? How many characters @message has in xp_readmail?
Thank you very much."

jasper_smith
SQL Server MVP & SQLTeam MVY

846 Posts

Posted - 2003-07-04 : 13:01:41
@message is actually text so you can certaily change @MessageText to varchar(8000) if that will be sufficent otherwise insert the results of xp_readmail into a table with a text column


HTH
Jasper Smith

0x73656c6563742027546f6f206d7563682074696d65206f6e20796f75722068616e6473203f27
Go to Top of Page
   

- Advertisement -