Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cleaning mailbox

Status
Not open for further replies.

h1234

Programmer
Sep 5, 2002
5
RU
declare @hMessage varchar(255)
exec master..xp_findnextmsg @msg_id=@hMessage OUT
while @hMessage is not null
begin
exec master..xp_deletemail @hMessage
exec master..xp_findnextmsg @msg_id=@hMessage OUT
end
----------------------------------------------------
This code delete only one message (the first), why?
 
Hi h1234,

I Know little about SQLMail, but I think
your script should be:

declare @hMessage varchar(255)
exec master..xp_findnextmsg @msg_id=@hMessage OUT
while @hMessage is not null
begin
exec master..xp_deletemail @hMessage
exec master..xp_findnextmsg @msg_id=@hMessage OUT
CONTINUE
end

 
"CONTINUE" is unhelpfull in this case :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top