Okay I was trying to be cheep with stored procedure memory and I am wonderin if any of you out there have any ideas.
1. I have 1 stored proce that calls 2 variables. Email and IRBTurnCounter, This proc calls for the lowest number (int) by desc so I get my email address to mail off the form with. Then I need the 'IRBTurnCounter' to increment by one so all the members of the table get called so everyone gets one email (eventually not at the run of this proc) Man I hope this makes sence!
2. What I have created works if ther are values placed in the fields at runtime... HOWEVER I need the values to be called and placed from the proc its self. I would rather not do it in two procs but if I have to than I have to.
Thanks for all the help in advance
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
Alter PROCEDURE [dbo].[P_sp_EmailerProgram]
-- Add the parameters for the stored procedure here
/* SET NOCOUNT ON */
select top 1 Email, IRBTurnCounter from tbl_IRBMembors Order by IRBTurnCounter Desc
IRBTurnCounter = @IRBTurnCounter + 1,
Email = @Email
WHERE Email = @Email