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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Don't know exactly how to use the trigger for this

Author  Topic 

Eagle_f90
Constraint Violating Yak Guru

424 Posts

Posted - 2002-04-15 : 20:52:46
I think the best thing in my situation is to use a trigger but I have not been able to figure out how to do it or find anything that explained it well enough for me to understand. Here is what I am doing, I have two columns, Movetime and Action. Now when Movetime is change from what ever the last data was to "N/A" I want to automatically change the Action column to "Resting"
Table Name: Information
Column names: MoveTime and Action (Action the one to be changed by the trigger)
Anyone have any ideas on how to use the trigger for this? Thanks


yoursfriend
Starting Member

5 Posts

Posted - 2002-04-16 : 02:25:19
Hi,

Try to do like this. It will solve your pblm.


Create Trigger Trg_Info
On Information For Update
As
Begin
If Update(Movetime)
Begin
Update Information Set Action = 'Setting'
From Deleted a
Where a.PrimaryKey/UniqueKey = Information.PrimaryKey/UniqueKey And
Upper(Action) = 'N/A'
End
End

Go to Top of Page
   

- Advertisement -