Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention. Check out this how-to article for more information.
UPDATE Table2 SET username = Table1.username , computer = Table1.computer , status = Table1.status , IP = Table1.IP , MAC = Table1.MAC , Time01 = Table1.time01 FROM Logonoff2 JOIN Table1 ON Table2.username = logonoff_all.username and Table12.computer = Table1.computer and Table1.status = Table2.status and Table1.time01 > Table2.time01 INSERT INTO Table2 (Username, Computer, Status, IP, time01) SELECT Table1.username, Table1.computer, Table1.status , Table1.IP, Table1.time01 FROM Table1 WHERE NOT EXISTS ( SELECT null FROM Table1 WHERE Table2.userName = Table2.username and computer.Table2 = Table1.computer)
Join the community of 500,000 technology professionals and ask your questions.