I have a problem described as follows: I have a table with one instead of insert trigger:
create table TMessage (ID int identity(1,1), dscp varchar(50)) GO Alter
SCOPE_IDENTITY() return the value from current scope and that is stored procedure outside from stored procedure it will be null.use @@identity to get last inserted identity.