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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2001-04-01 : 19:22:34
|
D. Sreenivasulu writes "I have written a Trigger to fire on particular event, it's working but for next unwanted iteration also it's incrementing the particular column by considering the previous state and updating the table properly after misfunction. At that instance it's not taking present stage information.
CREATE trigger DS1 on trkscrsl for update as declare @dsid int,@dsx14 int set @dsx14=0 set @dsid=0 select @dsid=Id from inserted select @dsx14=x14 from inserted if @dsx14 = (select chId from trkch where chLabel='Recycled') begin update trkscrsl set x18=(x18+1) where x5=@dsid end
the above trigger has to fire when x14 column of trkscrsl='Recycled' it's firing proprly and updating the table but for next iteration also it's incrementing even it's not 'Recycled',i,e after submission next stage as 'Fixed' also it's incrementing the iteration column which is on x18. I hope u got what I want to say please clarify ASAP." |
|
|
|
|
|