|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
AFTER UPDATE trigger fired before update
Please help,
I'm using a trigger to update a second table when changes in the first table occures. CREATE TRIGGER [TR_UPDATE_FLIGHT] ON [FLIGHT] AFTER UPDATE AS declare @id int DECLARE @Origin char(4) DECLARE @DEST char(4) select @id=id_FLIGHT,@Origin=ORIGIN,@Dest=DEST from inserted if update ([ORIGIN]) OR update([DEST]) BEGIN UPDATE BOMAP_FLIGHT SET ORIGIN=@Origin, DEST=@Dest WHERE id_FLIGHT=@ID UPDATE BOMAP_UPDATE SET LastUpdate=GETUTCDATE() WHERE [Name] = 'Flight' END I'm using ADO to access the DB from client. Rst.open “SELECT * FROM FLIGHT WHERE ID_FLIGHT=5” Rst!ORIGIN = “FRA” Rst.Update When I run the last line of this code I am getting the error message “Row cannot be located for updating. Some values may have been changed since it was last read.” The SQL-Profiler tells me that “StmtCompleted” of the trigger run before the Update stm of my client. Thanks for help Ron |
![]() |
| Viewing: Dev Articles Community Forums > Databases > Microsoft SQL Server > AFTER UPDATE trigger fired before update |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|