As an example, if I update a row in a table which has a trigger associated with it, is the value returned by @@RowCount the number of rows updated by my statement or by the trigger?
Ok I should have read the question more carefully and spotted @@rowcount rather than @@identity. But I'll leave this non-sequitur here as I might want to copy it somewhere later. It contains a comment about the output clause which surprisingly few people seem to have noticed.
It will be that returned by the last statement with the caviate that I believe a trigger doesn't set it to null as it ought.
If you insert into a table with an identity in a trigger then @@identity will reflect the identity value from the trigger insert, scope_identity will reflect the value from the firing statement.
If you insert into a table without an identity then @@identity is set to null. If you insert into a table without an identity in a trigger then @@identity is unaffected i.e. in the trigger and after it reflects the identity value from the firing statement - I'm pretty sure that this was cahnged in a service pack some time ago (maybe v7 sp2? and before that it did set the value to null - it's always worth checking).
With v2005 you have an output clause which you can use to return the identity value from tyhe inserted table. Not very helpful for single row inserts but very useful for batch inserts to return all the identities allocated.