var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Procedure returns wrong @@Identity
I have a procedure that inserts a record to a table and return the @@Identity as an output parameter.
This table has a trigger that is triggered when a record is inserted and add a new record to other table.
The problem is that the @@Identity returned is totally wrong.
Thanx in advance.
Is it returning the identity of the record inserted via the trigger or something completely different?
Have you tried disabling the trigger and seeing what is returned?
Re: Procedure returns wrong @@Identity
Remember that @@Identity is a global variable. It will return the Identity value that was last accessed by SQL regardless of what table it came from.
Check @@Identity in the BOL. There is another alternative that you can use (sorry, BOL is not available to me right now) that will allow you to pull the identity value for a particular table.