scope_identity() function returns the last inserted identity value across any table within a stored procedure(within scope).
select @value=scope_identity() ---will return the last inserted identity value within that scope.It may be identity value of any other table used in that SP.
select @value=scope_identity() from table ----i dont think this will be used.
Instead to know the last inserted identity value for a table,use ident_current(TableName)