Is it possible to catch the value of any field in a table? and once catched, can it be inserted into another table? SQL
The GO utility statement marks the end of a batch of T-SQL statements.

The variables you declared at the top of the first batch go out of scope after the first GO statement.  So you can't use them anymore in the 2nd batch (where the INSERT statement is).

To solve that, just remove the GO statement.

As far as your other goal, you can store the Id that goes with that UserName by changing your SELECT statement to this:

SELECT @tempUSERID = Id
FROM Users 
WHERE UserName = @tempUSERNAME;


Notice the variable assignment in the SELECT clause.