Are you sure it returns the three shippers? You have two FETCH's inside your WHILE. Move that first one outside the WHILE. Also, I'm not sure if it's necessary,but you might want to add a BEGIN and END.USE Northwind GO DECLARE abc CURSOR FOR SELECT * FROM Shippers OPEN abc FETCH NEXT FROM abc WHILE (@@FETCH_STATUS = 0) BEGINexec sp_SMTPMail @SenderName='Monitor', @SenderAddress='sender@abc.com', @RecipientName = 'Someone', @RecipientAddress = 'recip@abc.com', @Subject=CompanyName, @body=Phone FETCH NEXT FROM abc ENDCLOSE abc DEALLOCATE abc GO
Of course, that probably doesn't solve your problem. I'm not familiar w/that stored proc, but I thought I'd at least mention the problem(s) I saw.