Will this query cause any data corrutpion
A wrong query was submitted into production environment yesterday (this is
actually inside update and insert trigger of athn_pty_prd table). Query is
below:
UPDATE athn_pty_prd
SET a.lst_mod_by = SUSER_NAME()
, a.lst_mod_dt = GETDATE()
, a.credit_request_id = b.credit_request_id
FROM aud_athn_pty_prd a
, inserted b
WHERE a.athn_no = b.athn_no
AND a.pty_no = b.pty_no
AND a.prd_typ_grp_cod = b.prd_typ_grp_cod
Instead of joining with athn_pty_prd, we joined it's audit table
(aud_athn_pty_prd).
Today, DBA came to us complaining about weird queries being submitted to
the server (updates in bulk). Which looked something like:
update dbo.athn_pty_prd set athn_no=96445 where athn_no=96445 and
pty_no=443738 and prd_typ_grp_cod='OC'
update dbo.athn_pty_prd set athn_no=96445 where athn_no=96445 and
pty_no=443738 and prd_typ_grp_cod='FX'
Do you think that there is chance of possible corruption in the main
table. Above queries seems harmless as nothing is actually changed by the
update.
Any help would be appreciated.
DB: Sybase ASE 15.5
Thanks, Meet
No comments:
Post a Comment