sql - Insert only new or edited values to rows -
i have got attendance table follows.
id date time == ==== ==== 1 01/01/2013 17:00:00 1 01/01/2013 22:00:00
these table process stored procedure calculate total hours, deduction, rates etc..etc.. stored in table next result example.
id date timein timeout thours salary == ==== ====== ======= ====== ====== 1 01/01/2013 17:00 22:00 5 $50
what have done run select if exist. delete table. in order update edited entries in first table, ie, miss punches..
the sec table process through stored procedure time rounding, add together tag depending on results etc.. , stored in bigger tables contain fields incentive, overtime, advance etc.. etc.. table utilize final insertion of additional info through windows form.
now, we're stuck situation when we're trying add together new rows 3rd table. 2nd table get's deleted , recreated on update, , doing exist update etc don't seem work, , don't seem able depend on unique key 2nd table recreated on update.
appreciate suggestion on how can maintain 3rd table user edit..
just add together id 1st table 2nd table , client or whoever attendance doing sec table u should not delte sec table entries while updating
just check id of person in sec table matching id of first table
then 3rd have sec table id
sql
No comments:
Post a Comment