If you want to return the value you just inserted (to use to insert to child tables),then generally you need to use scope _identity(). It is specific to the scope of the statement your connection ran. It wil nto give you anyone else's identity value.
@@identiy, is also specific to your scope, but it also includes trigger valuies in the scope and thus if the table has a trigger that also inserts to an identity, that is the identity returned. as such, it means that @@identity should not be used to return teh value you inserted as it will start returnign the worng value as soon as anyone adds a trigger.
Then there is ident_current. This is the most dangerous of all because it retuns the last identitiy onteh table no matter which coneection put it in. So if you use that to get an identity value, you need to be awre that it is not necessarlity related to the record your connection put in and using this to get the identity to use to insert to child tables is a guarantee of data integrity problems.
Newer version of SQL server have an OUTPUT clause, this is far superior to using any of the three items above as you can return a set of identities and the values of other fields as well.