I have a query like so:
SELECT id, @RowNumber = ROW_NUMBER() OVER (ORDER BY id) as 'number'
FROM WaitList
WHERE email = @Email
However I am getting error:
Incorrect syntax near the keyword 'as'.
What I am trying to do is assign the ROW_NUMBER() to a variable.
I really need to get the row number from the WaitList table.
Could I put the results in variable table and then get the row number by selecting 'number'?