SET QUOTED_IDENTIFIER OFF
declare @email varchar(100)
declare @subject varchar(255)
declare @body varchar(4000)
DECLARE EMAIL cursor for
select EmailAddress, subject,html
from PORTAL.dbo.zTestEmails
where sent = 'False'
FOR READ ONLY
OPEN Email
FETCH NEXT FROM Email into @email, @subject, @body
WHILE @@FETCH_STATUS = 0
BEGIN
exec dbo.sp_portal_SendNotificationEmail @email, @subject, @body
FETCH NEXT FROM Email into @email, @subject, @body
END
CLOSE Email
DEALLOCATE Email
|