No I will not write you the code because I am not here to do your work for you, I will try to help you though. Since you are trying to do this inside of MS SQL I would suggest writing a stored procedures that would add your UserID and Event_Name to the database and then call @@Identity.
Here is why: if you call SELECT @@Identity, such as you are doing, it will return NULL for every record in the current table.
So your procedure would need to do this
INSERT INTO table(columns)values(values)
SELECT @@Identity
================================================== =========
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========