How to get the next ID

  • Hello,

    How would i find out the next ID from the current one i have selected, as at the moment i pass in a value which returns a row of information, inside that information i need to return the ID example

    1

    2

    3 --- Im currently select this one, also select 4 as the next ID

    4

    5

    ?

  • DECLARE @ID int

    SET @ID = 3

    SELECT ID + 1 WHERE ID = @ID

    ?

    ______________________________________________________________________________Never argue with an idiot; Theyll drag you down to their level and beat you with experience

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply