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 |
|
abi
Starting Member
6 Posts |
Posted - 2008-11-14 : 08:45:19
|
| Hi friendsI'm new to SQLI have two tables in a server(amschn and amsggn).amschn has got four fields(ecode,day,in_time,out_time)amsggn has got five fields(ecode,day,in_time,out_time,status)I want to write a trigger such as whenthere is a insert/update(entry) in amschn(in_time) it should update the 'status' field in amsggn as present.Please help me |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-11-14 : 08:55:24
|
| [code]CREATE TRIGGER yourtrigger ONamschnFOR INSERT,UPDATEASIF UPDATE(in_time)UPDATE tSET t.status='present'FROM amsggn tINNER JOIN INSERTED iON i.ecode=t.ecodeGO[/code] |
 |
|
|
|
|
|