Home Forums SQL Server 2008 T-SQL (SS2K8) amending a column to increment while inserting; then switching back RE: amending a column to increment while inserting; then switching back

  • DamianC (10/12/2016)


    Using your suggestion sergiy, I've managed to get it working

    One question

    You have:

    declare @MaxID bigint

    select @MaxID + MAX(ID) From TargetTable (TABLOCKX)

    This returns NULL

    I've amended it to (changed + for =)

    declare @MaxID bigint

    select @MaxID = MAX(ID) From TargetTable (TABLOCKX)

    Was it a typo or have I missed something fundamental?

    Thanks

    Damian.

    Typo. Well spotted.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.