Hello Borislav!
In help Transact-SQL :
@@IDENTITY, SCOPE_IDENTITY, and IDENT_CURRENT are similar functions because they all return the last value inserted into the IDENTITY column of a table.
I have chosen first.
Now I try to use SCOPE_IDENTITY() function.
Thank you for answer.
>NEVER use @@IDENTITY, If you have trigger that affect other table that have >IDENTITY field you will get wrong information.
>Use SCOPE_IDENTITY() function instead.
Create PROCEDURE [dbo].[insert_mytable]
@l_1 int,
@l_2 varchar(20)
AS
Insert into cred.dbo.mytable (field1,field2) VALUES (@l_1, @l_2)
Select SCOPE_IDENTITY() as 'Identity'