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)
 Reinsert deleted data?

Author  Topic 

steamngn
Constraint Violating Yak Guru

306 Posts

Posted - 2006-07-25 : 15:26:46
Hi gang,
Here's a goodie:
Two tables, PS_TKT_HDR and TIMETABLE. Users of the company POS app open a single record to edit from PS_TKT_HDR. When a user opens a record from PS_TKT_HDR this locks the record in the app, disallowing anyone else to touch it until saved back to the table. This is fine, except that TIMETABLE has a trigger on it which updates PS_TKT_HDR. TIMETABLE can be accessed from the same screen that users use to access PS_TKT_HDR, and thus can make a change in TIMETABLE that changes PS_TKT_HDR while the user has the record open. Then when the user saves the changes to PS_TKT_HDR the changes from timetable are lost. PHeeeww!! Ok, This problem is related to two columns in PS_TKT_HDR; SVC_DAT and SVC_TIM. Can a trigger be written on PS_TKT_HDR so that if these columns are NOT NULL in DELETED the deleted values get reinserted? Does this make sense? Vendor says app changes will be a long way off, and this is a real problemmmmmmmmmm...
Thanks in advance!
Andy

There's never enough time to type code right,
but always enough time for a hotfix...

mahesh_bote
Constraint Violating Yak Guru

298 Posts

Posted - 2006-07-26 : 09:32:31
check where the trigger on timetable is after or before update.

BMahesh
Go to Top of Page
   

- Advertisement -