i m using SqlServer 2000 and i have 2 tables :
The 1st Table is : "UserActivityLog": (With following column names)
The 2nd Table is : "SessionOnline" (With following column names)
now i want to write a Trigger (Before), After insertion in the first table the inserted values
automatically goes to the 2nd table."SessionOnline" but for the specific SessionID.
e.g. if i make some new insertion in table 1 and write sessionID =1 for 1st insertion after insertion , i make
new insertion again in the table1 and for the same sessionID =1 then my 2nd table updates with the new
As for 1st table i made 3 insertion for sessionID=1 then in my 2nd table the last inserted value goes to the 2nd
table. (Each time my 2nd table Updated if i make new insertion for the same sessionID) coz in 2nd table
for each sessionID i have only one entry in the 2nd Table "SessionOnline".
plz reply me asap
its very urgent.plzzzzzzzzz
Refer to Audit Trail in SQL Server 2000 or SQL Server 7. It creates a trigger for update and delete but it shall gets you moving for the inserts as well.
|All times are GMT +5.5. The time now is 02:04.|