I have been working at this for an hour now and with no success.
--Table 1
tblSessions
session_id
login_time
user_name
--Table 2
tblLastLogin
user_name
last_login_date
Currently tblSessions gets cleared by a stored procedure. I don't want to modify any existing objects. I am looking to have a trigger occur after a record is inserted into tblSessions table to insert or update into the tblLastLogin.
EXAMPLE:
When the following information gets inserted I want it to create or update the entry as outlined in the table tblLastLogin
tblSessions
--------------------
Session_id login_time user_name
---------- ---------- ----------
15 2010-09-07 08:57:20.167 myuser
tblLastLogin
---------------------
user_name last_login_date
--------- ---------------
myuser 2010-09-07 08:57:20.167
--Table 1
tblSessions
session_id
login_time
user_name
--Table 2
tblLastLogin
user_name
last_login_date
Currently tblSessions gets cleared by a stored procedure. I don't want to modify any existing objects. I am looking to have a trigger occur after a record is inserted into tblSessions table to insert or update into the tblLastLogin.
EXAMPLE:
When the following information gets inserted I want it to create or update the entry as outlined in the table tblLastLogin
tblSessions
--------------------
Session_id login_time user_name
---------- ---------- ----------
15 2010-09-07 08:57:20.167 myuser
tblLastLogin
---------------------
user_name last_login_date
--------- ---------------
myuser 2010-09-07 08:57:20.167