I don't really know SQL Server, but could it be that nothing was inserted? The issue may not be with @@IDENTITY, but with what you are inserting?