Forum Replies Created

Viewing post 1 (of 1 total)

  • RE: Generate Next Numbers with SQL Server

    --Lock the table;

    DECLARE @integer_variable int

    IF @@trancount = 0

    Begin Transaction;

    -- Perform Update

    Update table

    Set Tablename.Seqnr = Tablename.Seqnr + 1

    Where Blabla

    --Perform Errorhandling !!! (no code inhere)

    -- Perform SELECT

    Select seqnr

    FROM table

    Where blabla.

    -- Perform Errorhandling...

Viewing post 1 (of 1 total)