Although direct database update isn't recommended in SAP, still for some strange reasons it was needed in one of the projects to modify a wrong entry done by functional consultant. One of my fellow programmer was assigned this task and this is what she did - Update set = instead of Update set = where The code was executed on development server(thankfully) and it created a big mess. Full day work of 5 guys was lost. P…
I Accidentally Deleted All Our Data
11–20 of 78 posts
Re: I Accidentally Deleted All Our Data
#12I've done this a few times in my career. I'm smart enough now to always backup before I make any potential mistakes and test everything on a staging server. The worst was executing "DELETE FROM " instead of "DELETE FROM where userid='X' on a production server.
SELECT * from some_table where idx >= 5
Then, once you are staring at the records that came back
(and are sure they are the ones you want to delete),
change SELECT * to DELETE (and change nothing else) and
rerun. DELETE from some_table where idx >= 5
Pretty hard to get it wrong with this approach ;-)Re: I Accidentally Deleted All Our Data
#13Re: I Accidentally Deleted All Our Data
#14Who works with a prod database in an interactive interpreter? My eyes are literally wide in shock.
Re: I Accidentally Deleted All Our Data
#15Re: I Accidentally Deleted All Our Data
#16Who works with a prod database in an interactive interpreter? My eyes are literally wide in shock.
Re: I Accidentally Deleted All Our Data
#17week? That seems kind of off. I'd suggest setting up backups more often than that, especially for production data.
Sorry to hear about that. I destroyed a drive once a long time ago (~1994) as well. Happens to the best of us.
Re: I Accidentally Deleted All Our Data
#18Who works with a prod database in an interactive interpreter? My eyes are literally wide in shock.
Re: I Accidentally Deleted All Our Data
#19I've done this a few times in my career. I'm smart enough now to always backup before I make any potential mistakes and test everything on a staging server. The worst was executing "DELETE FROM " instead of "DELETE FROM where userid='X' on a production server.
As it, when I'm writing sensitive SQL to fix an issue I end up writing the where clause first as a SELECT, then issue it.. check the results, history up, ctl-a and replace with a DELETE. Harrowing stuff.
Re: I Accidentally Deleted All Our Data
#20I've done this a few times in my career. I'm smart enough now to always backup before I make any potential mistakes and test everything on a staging server. The worst was executing "DELETE FROM " instead of "DELETE FROM where userid='X' on a production server.