Some advices for common programmers problems

Hello to everyone ;)
My next post will learn you to create trigger in MSSQL and grabb into it row id from table.
For example simple table
contact:

id | name|
1| Jon|
2|Marry|

archive_contact:

aid| aname| date

For example: for each change column data (name) in relation contact you want logged it into relation archive_contact and put there old data
so start
CREATE TRIGGER [contact_to_archive]
ON contact
AFTER INSERT, UPDATE
AS
SET NOCOUNT ON
SET ARITHABORT ON
Declare
@id Int,
@name varchar(100)

Declare contact Cursor Local Fast_Forward For
Select
id,name From inserted
Open contact
While 1=1
Begin
Fetch Next From contact InTo
@id,
@name
If @@Fetch_Status <> 0 Break
INSERT INTO archive_contact(aid, aname, date) values (@id, @name, getDate())
END
Close contact
Deallocate contact
SET NOCOUNT OFF

It should work fine if not contact whit me ;)
@@Identity it is not good, sometimes it can return id from archive_contact