having problems with this stored proc.
I can get it to populate the fields that it needs to but its not auto incrementing the table as designed.
Basically it's supposed to go like this
Select the top record with the lowest int in IRBTurnCounter then it needs to add a 1 to the value of the selected record so instead of IRBTurnCounter for the selected record being 1 it becomes a 2
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
ALTER PROCEDURE [dbo].[P_sp_EmailerProgramV2]
-- Add the parameters for the stored procedure here
DECLARE @Email nvarchar(50),
/* SET NOCOUNT ON */
select top 1 Email, IRBTurnCounter, FirstName from tbl_IRBMembors Order by IRBTurnCounter Asc
IRBTurnCounter = @IRBTurnCounter + 1,
Email = @Email
WHERE Email = @Email