Results 1 to 2 of 2

Thread: @@IDENTITY bug

  1. #1
    Robert Habibi Guest

    @@IDENTITY bug


    Does anyone know if there is bug/problem with the @@identity global variable in SQL Server 7.0?
    I have a stored procedure that inserts a row into a table with an identity column and returns (outputs) the value
    of the identity column just generated. The SP is called by a Java program. The SP works fine most of the time,
    however from time to time it retuns a NULL value! Your comments/suggestions are much appreciated.

  2. #2
    Peter Gribanov Guest

    @@IDENTITY bug (reply)

    Have you applied SP1? Problem may be caused INSERT trigger on table.If INSERT trigger inserts values in table without IDENTITY column, @@IDENTITY sets to NULL. This bug is fixed in SP1. By the way, if INSERT trigger inserts values in table WITH IDENTITY column, @@IDENTITY sets to last IDENTITY value in table mentioned in UPDATE trigger.
    If you've already applied SP1 and your table has not trigger on INSERT - no ideas.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •