Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
mody82
Starting Member
13 Posts |
Posted - 2009-01-26 : 09:22:55
|
| Dear All I need a Trigger that will delete a record from one table and insert it to another table , in outher meaning >> I have two tables T1 and T2 , T1 contains new Employee and T2 contains Old Employees , So when I delete an old employee from the T1 table it should be insert it in the T2 table >> Hope that it's clear << |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-01-26 : 09:25:53
|
| [code]CREATE TRIGGER CaptureOldEmpON T1AFTER DELETEAS BEGININSERT INTO T2 (columns...)SELECT columns...FROM DELETEDEND[/code] |
 |
|
|
mody82
Starting Member
13 Posts |
Posted - 2009-01-26 : 09:50:26
|
| Thanks Visakh,,, I tried it's working nicely |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-01-26 : 10:04:29
|
| welcome |
 |
|
|
|
|
|