Always do a select with your criteria before doing a Delete or update. Don’t ask me how I learned this.
Gone are the days of hard deletes in my approach; it's exclusively soft deletes now!
The day I locked everyone out of the company intranet
61–70 of 130 posts
Re: The day I locked everyone out of the company intranet
#62Use chatGPT to double check too.
"Yes, you can delete those items via that query." "But now all has been deleted??!?! WTF HEEELP" "I apologize for my previous answer, you are correct, you now deleted everything!"
Re: The day I locked everyone out of the company intranet
#63Always do a select with your criteria before doing a Delete or update. Don’t ask me how I learned this.
Came here to say exactly that! I do a select count and then a limit against the returned count. At least it may reduce the blast radius.
Re: The day I locked everyone out of the company intranet
#64My chooosen database explorer is Dbeaver. Horrible name but great app. You can set colours for local/test/prod servers and a red colored tab will scream at you to be cautious. And with red color every edit will pop up an "are you sure?" question. And autocommit is off. I sorta stopped making unrecoverable mistakes.
I run a local copy of the database I connect to remotely and I have to be careful about which database/table I’m connected too.
Re: The day I locked everyone out of the company intranet
#65I was working on an old old old "ERP" system written in D3 PICK. It's a database, programming language and OS all in one with roots in tracking military helicopter parts in the 1960's. I was working on it in the mid-2000s. It had SQL like syntax for manipulating data, but it was interactive. So you would SELECT the rows from the table that you wanted, then those rows would be part of your state. You would then do UPD…
Re: The day I locked everyone out of the company intranet
#66Earlier quoted context omitted.
Came here to say exactly that! I do a select count and then a limit against the returned count. At least it may reduce the blast radius.
In most of my scenarios, I'd actually rather cause a catastrophic global change than a silent subtle corruption of a handful of rows
Re: The day I locked everyone out of the company intranet
#67These kinds of scenarios happen when money is "cheap", and highlight why the current recession, and coming 2nd great depression aren't really a bad thing.
Re: The day I locked everyone out of the company intranet
#68 rmdir . /s /q
only to notice what I am in the wrong folder, way up in the hierarchy.And repeat the same error years later when the batch file failed to cd to the destination folder. Added
if %CD% == %DESTDIR%
to avoid that problem.Re: The day I locked everyone out of the company intranet
#69Back in the 90s I remember a work colleague asking 'can you rollback a drop table?', to which I replied 'no', and all the blood drained from his face in seconds. It's one of those things you've heard happens to people, but until you see it, you can't quite believe it.
Since this seems to be such a common occurrence, why haven't databases evolved to maintain some limited form of history that can be rolled back? Have no idea of the complexity, so forgive me if that sounds daft.
Re: The day I locked everyone out of the company intranet
#70Back in the 90s I remember a work colleague asking 'can you rollback a drop table?', to which I replied 'no', and all the blood drained from his face in seconds. It's one of those things you've heard happens to people, but until you see it, you can't quite believe it.
Since this seems to be such a common occurrence, why haven't databases evolved to maintain some limited form of history that can be rolled back? Have no idea of the complexity, so forgive me if that sounds daft.
Then come the “site is down and the world is ending” tickets, messages, emails, and phone calls.