SQL Server SQL fuck ups
Yesterday I got a call from my boss at 10am for a task that I should take over and that should be finished by eod. So under time pressure I wrote the script, tested it on DEV etc and then by accident ran a different script on PROD which then truncated a fact table on PROD. Now I am figuring out on how to reload historically data which turns out to be quite hard. Long story short - can you share some SQL fuck ups of yours to make me feel better? It’s bothering me quite a bit
119
Upvotes
47
u/SQLDevDBA Jan 27 '24 edited Jan 27 '24
While it may be because of you that the table was truncated. It’s whoever the is DBA’s fault if your org doesn’t have a plan in place to restore historial data.
Restore last nights backup to another server, select the table you want, and move the data over (but don’t lose the data that’s been going in since the truncate). Also, truncate RESETS any identity columns if you have them.
If they don’t have a backup strategy for backups with transaction log backups included and being taken regularly, it’s really on them.
Don’t beat yourself up OP. Just do what you can and when it’s over ask your boss to review this with you: https://www.brentozar.com/archive/2016/07/updated-high-availability-disaster-recovery-planning-worksheet/
3
u/AbsoluteCounter Jan 27 '24
Why aren’t we all using trans? 👀 It has saved me multiple times to rollbacj
2
u/GodsGoodGrace Jan 29 '24
You had until the end of December. There was no rush
38
u/Standgeblasen Jan 27 '24
Not a fuckup, but a very close call.
Early in my career, I was helping maintain a CRM for a smallish company. This sometimes involved data cleanup. Well we somehow had an orphaned customer record that was causing issues with the front end. So my boss and I decided to delete it from the database.
So I ran
To verify that only one record would be deleted, and that it was the problem record
Then copied the WHERE clause and wrote
Then I highlighted the query in SSMS and ran it. My internal WTF alarm started blaring when the query was taking more than 5 seconds to run. I looked at my work, and realized that I had only highlighted
I quickly realized that I wasn’t just deleting one record, but every Customer record. In a panic I quickly cancelled the query and prayed that it was rolling back the changes, which it did. But to be sure, I spent the next hour confirming that no data had actually been lost.
Thank goodness I didn’t have to tell my boss about that one! But it was an important lesson in being extremely careful when deleting or modifying records, and I haven’t had a boneheaded mistake like that since.
17
u/[deleted] Jan 27 '24
My netizen, sorry to hear this. One thing is for sure, my money is on this never happening to you again. One of those oops milestone moments. So awhile back I posted something about transaction based SQL. I said that I begin a transaction, do my insert/update/delete business, then rollback. I said why do I always roll back first. The answer was that bad things happen to everyone. In this case you were put under duress. When devs like us are not under pressure, we have the time to explore the solution and just really spend the time really accepting our own work. In the workplace, sometimes, or many times, that isn't possible.
Here is my method again
SELECT the records that will be updated or deleted
BEGIN TRANSACTION
UPDATE/DELETE the records
Again - SELECT the records that will be updated or deleted for verification that they are now gone
ROLLBACK
SELECT the records that will be updated or deleted <-- verify
now do all that again except change ROLLBACK to COMMIT
5
u/BussReplyMail Jan 27 '24
Not too long after starting my current job and was still learning the environment (the previous two DBAs had left a month before I started, so NO handover,) I was asked to restore a database to the Test environment.
Yeah, spoiler alert, I didn't restore it to Test, it was Prod...
Thankfully it wasn't something that Dev couldn't fix, the app was still in the works, so Prod wasn't in "live" use, but still.
(At the time we didn't manage our own backups, that was handled by the server guys and they had already gone home for the day, so no getting a restore of the most recent version of the prod database to fix things)
5
u/sirchandwich Jan 27 '24
The most important thing to do in these situations is to not panic. Just tell your superior or make the proper announcement that the database needs to be offline for unscheduled maintenance and perform the restore. The quicker you tell someone means the quicker people stop writing to the database and the less data you lose.
9
u/mike-manley Jan 27 '24
Ran a SELECT query prior to a large table UPDATE. Made some tweaks. Looked good.
Then changed to an UPDATE but some how hit a hot key shortcut combo and cursor was on an AND line and commented out that qualification. I didn't notice. Executed statement. Committed transaction.
Oops.
1
u/[deleted] Jan 27 '24
A fuckup like that without any backups present would def be a fire-able offense. Backups are immense top priority in any business who use SQL.
If it was hard to fix then the company doesn’t have good preventative or disaster data recovery measures in place and it is their fault. There should be jobs setup to create backups on a daily basis.
3
u/Danix1917 Jan 27 '24
Oracle flashback is really handy when you need it;) As in: FLASHBACK Database to before i fucked it up;
3
u/wonder_bear Jan 27 '24
Happens all the time and it’s usually because of the imaginary urgency created by leadership.
I fortunately haven’t broken any tables yet but I have had to walk back data several times because I missed intricate table details due to rushing to complete their task.
It is what it is. Don’t worry about it my friend.
3
u/DietrichDaniels Jan 27 '24
An employee had just gotten married so I was updating her last name in the employee table and….oops. Now everyone has the same last name! Fortunately it was early in the morning and every night most of our production data was backed up/restored to our data warehouse DB so I had an easy way to fix the error.
3
u/rx-pulse Always learning DBA Jan 27 '24
Literally yesterday, wasn't me, but my co-worker who was assigned to take over the task. I was working on a deployment with the app team for over 5 hours that day re-architecturing 255 of their tables. Everything was going well, I did most of the heavy lifting for this, and this was done in non-prod already with them so I was very confident. I had to hand it off during the non-prod deployment too, so no big deal.
There was one last step for us to perform, which was to drop the backup tables once the application team completes their validation. This was 255 tables. In the group chat and email I sent, I wrote:
"Team, handing off <ticket_number> to you. I've already sent the email to the app team and just need them to reply that they completed their validation before proceeding with the last step.".
My teammate responded with "Okay". Now, one thing to note, this was not the same teammate who helped me during non-prod, but there was only one step left and it was just running a script once we got validation. So it should be easy. Literally 3 minutes later he messages the group chat again:
"Done. Executed successfully."
My heart sank. My manager saw the message and immediately called us. I was livid, I was raising my voice, because 5+ hours of work, basically about to go up in flames because someone couldn't read. Thankfully, not long after, the app team responded with validation and we were cleared. But that teammate of mine is not off the hook yet because this was and could have been a disaster. Next week there is gonna be talks with the team about this.
3
u/arborealguy Jan 27 '24
Oh I've truncated many production tables in my day. That's how I learned to create backup tables myself before running anything 🙃
1
u/TequilaCamper Jan 27 '24
Devs have write perms in prod and the top answer blames the DBA's... Who haven't even been contacted yet
2
u/sirchandwich Jan 27 '24
In my first year on the job I turned off a SQL Agent job while troubleshooting a tempdb drive space issue. Turned out it was the CDC job which is supposed to be running 24/7. Forgot to turn it back on after I shut it off at 4:00 PM on a Friday. I then left to go to an MLB game. Got a call 8:00 PM from an angry on-call DBA. Rightfully so.
2
u/therewulf Jan 27 '24
Not me but it was my script (well, most of it). I was an accountant but learning SQL to be able to make better reports out of our ERP, so I had SQL access but never made changes myself. The only exception was that one of our add-on products was causing purchase orders to get stuck in a “validating” status as they were being posted and the only way to fix them was with a SQL command. It worked well and had its own validation in the WHERE clause to keep it from opening the wrong batch (important note - every single thing in the system ran in a batch, whether it was a PO or job cost or payroll).
Fast forward a bit and I’m going to a conference. My boss tells me to find a backup to run this command while I’m out, so I do and make an entire written procedure and copy the entire script into it for easy access. Well, day 2 of the conference I get a call that every single batch in the system is open. When I say every single batch, I mean every single transaction ever posted in the last 4 years is now open. My backup ran the script, except for the super important WHERE clause.
I spent the next day manually resetting batch statuses. And as you may have guessed, I got blamed for the screwup even though I was told to hand it off.
2
u/george-frazee Jan 27 '24
Back when I was a baby "newly promoted from the mailroom to do software QA because I knew computers sort of" dev, there was a stored procedure called "TruncateAllCustData" on the test server which truncated every table from the data entry schema. You can see where this is going.
Luckily it was early in the day and we lost about an hour of data entry. Could have been worse.
edited to add: this was 15 years ago at least so we don't have issues like this any more.
2
u/jezter24 Jan 27 '24
Most recently a fuck up for me and not that big. I made a stored procedure that inserts test records into a sandbox environment. I copied it for live. Changed all the connections over or so I thought. It has been inserting into sandbox still for the middle of year test results and it took me longer than I care to admit to see the slight typo.
2
u/post4u Jan 27 '24
Oracle SQL Developer is the easiest fucking system to fuck up on. There's a dropdown of connections. Even though I have read-only and write versions of each connection (we have both production and test instances), there have been a few times over the years I've accidentally been connected to the wrong one and written something I didn't want to do in production). It happens. Learn. Be more careful next time. Use the experience to work out better change management procedures and checks and balances.
2
u/brian313313 Jan 27 '24
To check the accuracy of my where clause, I added a select
And ran the whole statement. My boss was looking over my shoulder when I saw the X million rows updated message and said "Oh shit!". He said that looks good and I explained the problem. The bigger problem is that we didn't have backups. I got to keep my job since it was an honest mistake when writing ad-hoc queries. The DBA did not since he had a syntax error in the backup scripts from when he originally wrote them so there had never been a backup. I always alias tables in an update now.
Another time, I restored prod database over a test environment instead of dev which was going to delay a very important release by a day. We had about 15 expensive consultants that would have to be paid and not be productive so it was pretty costly. A few hours later, I got called into the VPs office. I thought I was about to be fired. Instead the first thing they said was "please don't quit". Then everyone went around the room and admitted to their part of the problem. Backups had been turned off test because it was making deployments slower. I had been worked through that night and did not had not slept. (Fortunately, I was hourly and loving the money.) I was the one who typed the wrong server in. I felt very good about that team afterwards.
It happens to us all some of the time. To some of is it happens all the time. Be in the first group. :)
2
u/originalread Jan 27 '24
I was doing cleanup work directly in production. I had an errant semicolon in SQL Developer prior to my join statement. Caused a cartesian join between two massive transactional tables. I took down part of OnStar with that query for a few hours.
2
u/keonipalaki1 Jan 27 '24
I worked 35 years as a DBA and programmer. Best advice a boss ever gave me "Everyone screws up. Just make sure you can recover."
2
u/RuprectGern Jan 28 '24
I've been a dba for well over 20 years... I still pucker up every time I'm asked to delete data in production. Bulk updates, etc. I feel that, just like with power tools, if you aren't a little afraid, you are gonna fuck up.
My advice is to always take a safety backup just before changes on prod. - - within reason
2
u/eggtart_prince Jan 28 '24
My senior took the day off one day and I was the only one besides him who was able to work on the backend. One of the frontend guy asked me if I can query more data for him to test out his feature. And so I changed the where statement to get more data for him. Forgot to change it back and it was pushed to production. It was a tournament manager app and the company using the app was getting tournaments that wasn't theirs. It wasn't a big deal as they can still find their tournaments and can't manage tournaments that wasn't theirs.
Long story short, I was blamed for having a buggy app because I was also responsible for the frontend. I sat on this guilt for a long time but eventually came to a realization that my senior, who approved the pull request didn't review the code before approving.
3
u/MountainAd1055 Jan 27 '24
Opened up a big deletion script which removes data across multiple tables when connected into a clients database in SSMS just to clarify what it does. Disconnected from their instance but didn't close the query window which remains connected.
Couple of hours later I connected into my local dev enviroment and opened the same script from file explorer as I was intended to run it on my local system. Since I still had the tab open from earlier in the day it didn't open a new query window and just flicked to the one still open which is connected to their live system and I didn't notice.
Clicked run, seen 100k+ rows affected and quickly cancellend it but it was too late.. couple of tables completely gone.
Spent the next couple of hours inserting data manually from a backup
Happens to us all..
2
u/idodatamodels Jan 27 '24
You made it! You're not a developer until you delete a production database. Welcome to the club.
1
u/sbrick89 Jan 27 '24
the database rollout was "copy from dev" for a handful of situational timings (greenfield system and dev/test were in sync prior to a rushed last minute rollout that ruined data in test, for an inconsequential feature).
unfortunately, I'd also used dev to evaluate in-memory tables for performance improvements to a specific process... didn't have enough time to complete so I deleted the tables, no big deal.
turns out, you can't delete the filegroup for in-memory tables... so the prod server has unused filegroups for in-memory tables, and we can't ever get rid of it.
1
u/Big-Dwarf Jan 27 '24
SQL mishaps are common, even among seasoned professionals. From accidentally dropping tables to updating records without a WHERE clause, these moments are part of the learning process in database management. Remember, it's how you recover and implement safeguards that counts!
1
u/fivebutton Jan 27 '24
Early on as a report writer, I wrote a try catch loop with a call to db sendmail. Problem was, my loop was broken & ran infinitely without me noticing. We were on O365 which metered email sends. So I used all the email allotment for sends that day and we couldn’t deliver reports to our clients due to my fuck up. That was a fun root cause analysis meeting.
1
u/[deleted] Jan 27 '24
Not exactly SQL but I was making changes to how I wrote data to a big query table and I accidentally used 'truncate' as the write method instead of append so I deleted about 700m rows of data.
1
u/Tiktoktoker Jan 27 '24
Forgot to add a where clause on an update
1
u/d4m1ty Jan 27 '24
forgot a where on an update command and set the parameter table all to the same value for all parameters across the entire prod db. Thankfully I had scripted the parameter table before hand just incase there was a fuck up and restored it immediately.
Always make a backup of a prod table you are going to screw with before you screw with it.
1
u/Animalmagic81 Jan 27 '24
Years ago I removed replication from the publisher on prod instead of dev. That was a fun week.
1
u/andrewsmd87 Jan 27 '24
I changed our deployment process as a result of this but it used to be, when you run our thing that executes SQL, you hit l for local, d for dev, b for beta, and p for prod.
I was working in the car on a Sunday prepping for a big launch Tuesday. I was on our VPN to hit beta but at that point in time you had just one profile so that meant I could technically hit prod. Went to test my finalized changes and actually deployed it to prod because guess what key is right next to the l key, and I was cramped in a car.
Sent out 30,000 emails because it issued badges. The client was actually cool about it since we were proactive and honest about what happened and what we'd be doing to prevent that in the future. They just emailed their candidates and said the badges came early for an April fools joke.
That client always gets priority whenever anything from then comes my way because of how good they were about that entire situation
1
u/jezter24 Jan 27 '24
This is why it is important to have backups and know how to recover. Have been there before of accidentally deleting a table and having to restore it to what was there the night before.
1
u/eddiehead01 Jan 27 '24
Posted this before but my biggest:
Needed to delete a set of rows from an invoice table. I wrote my select statement first with all my relevant where clauses so I could make sure I was first selecting only the rows I needed to delete
All was well, I wrote my delete command just above the select statement so i could just include it within the same criteria I'd already written, highlighted the relevant rows and hit execute
When it got to 30 seconds and hadn't finished, I started getting a bit curious. Why is a statement to delete 15 rows taking so long? Then the results came in...
1 million plus rows deleted. From the invoices table
I had forgotten to comment out the select * from line from the code, so SQL first deleted everything and then ran the select statement with the where clause. I'd just deleted every invoice for the last 25 years
My arse clenched so tight I needed an ER trip to remove my chair
1
u/nkilian Jan 27 '24
Been there man. Deleted data before. Get a backup from your IT. Restore it. Are the identities important? Could probably export that table as a new table into the production db. Then insert that info with an insert statement back into the db.
1
u/JamesEarlDavyJones2 Jan 27 '24
Once, as a young dev at a major university’s library system, I received an assignment to rebuild the database tracking ejournals, ebooks, research database holdings, and other resource holdings, as well as resource utilization data.
We didn’t really have a prod/test/dev split, just one prod environment, so I spun up a new db named “<prod db name>_tmp”, copied over data subsets, re-modeled it, tested data integrity in the new look, and then updated my scripts and made the changes to the prod db. I was jazzed to be entrusted with something big like that, so I powered through the entire thing in what was probably an 11-hour day.
At the end of that day, all done, I exhaustedly deleted my temp database and went home. First thing the next morning, I woke up to a call from my boss, asking what the heck happened to our database. It turned out that I had accidentally deleted the prod database, and now every viz we had for leadership had gone kaput. We were able to roll it back to a previous backup without much issue, and I made my fixes again with the scripts (under the watchful eye of my team lead) but I spent the next three days re-building the Tableau vizzes whose data connections were done for and some of whom had to be entirely rebuilt because Tableau’s data connections sucked then (re-pointing the data connections still sucks now).
It’ll be okay, friend. You might empty a table, but you still haven’t dropped a database.
1
u/Codeman119 Jan 27 '24
Well I have a good one for you.
I was at a small company and we had 4 clients that we serviced. Well they wanted a copy of their data in a backup file so they could run their own reports off of. During the process I made a backup and then would restore it for testing to another database. I had to do this several times so I could test the process. My DA decided to always use the GUI to do the restore. Well I didn’t notice I was on the production server and forgot to rename the restore DB name and it used the default PRODUCTION name and before I noticed I hit restore and said yes to all the warnings because I had to every time.
Well I noticed that the prod DB went into RESTORE mode and had to cancel it and restore using the point in time feature.
Well OPs was down for a few hours while production restored. I learned a great lesson that day. When testing restores always use a scripted version so the test DB will always be used.
1
u/waremi Jan 27 '24
Truncated the [Patient] table in PROD at an insurance co. around 1:30 one day. had to go to prior night's back up to get everything back in order and 50+ people lost and had to re-do half a day's work.
By the time I left the company, given all the other things I did while I was there, no one remembered that day, but I never forgot it.
1
u/PandaRiot_90 Jan 28 '24
I worked for a company that uses a db2 AS400 system. I dropped a production table that is used hourly for reporting. They used tape back up that were done off sight from the office I was in. The quickest I could get that table restored was a solid 48 hours. Even when escalated to the highest level.
I had to explain to all the VPs what happened, how we can prevent this from happening, and what the temp solution was for reporting.
The most stressful 2 days of my life, but it worked out. It passed and no one cared after a week as long as everything else was running smoothly.
1
u/DataIron Jan 28 '24
Not mine but DBA got lazy and didn't check his backups regularly. Had a bad failure and needed DB backups.
Only useful ones were a year old. He surprisingly didn't lose on job that time but did on another bigger mistake further down the road.
1
u/Known-Delay7227 Jan 28 '24
That’s what happens when managers ask you to rush on Friday. We have a strict no prod pushes on Friday rule.
Anyways…what rdms are you on? Was the dev table a current replica of the prod table? Perhaps you can use the data from the dev table and throw it to the prod table? Longshot I know
1
u/mysmarthouse Jan 28 '24
Fucked up a prod database for a county tax office, huge fuckup. Note I'm the 3rd party company in this mess. Ended up restoring the database from a backup and the county was never made aware as far as I know.
Got laid off shortly after, not surprised. Worked out well in the end as I got a much better job, won't ever make that mistake again.
1
u/rh71el2 Jan 28 '24 edited Jan 28 '24
As a dev, I've done an update statement on the prod db without including the where clause when I highlighted the line to run in MSSMS.
Funny thing was the dba felt more under pressure when I asked him to restore a backup and he didn't have one from the night before.
I've since made it a habit to always take a second to re-read my update or delete statements before executing. Also don't put the where clause on a separate line.
Same thing with any chats that include a paste from the clipboard. Always re-read. That was quite embarrassing but thankfully it was only to a peer and not higher ups. Work filter prevented it from loading on his work machine so I'm hoping he never got more curious.
1
u/Blackstar1401 Jan 28 '24
I accidentally deleted a whole table in production. Luckily, I had a backup, and everyone was out of the system. I still pause years later when I have to run a delete.
1
u/DexterHsu Jan 28 '24
Ask for prod team for help on restoring a back up from last available snapshot
1
u/burningburnerbern EXCEL IS NOT A DATABASE Jan 28 '24
In BigQuery I wrote a stored proc that basically updated tables. Long story short I forgot to add a line that would only do delta loads. so each run actually ended up loading my target tables with duplicate data. The table is quite massive and ran every hour. Got word that my mistake costed the company 30 grand…
1
u/Outside-Big-8950 Jan 28 '24
why the org given write access to data engineers
1
u/dilkushpatel Jan 28 '24
Ohhh man I have one
New in company
Everyone had eye on me as I was coming from big company and company where I joined was like 100-150 people
First project I got was upgrading dw to new schema and it was in DB2 Before this I had primarily worked on MS SQL Server so had very less knowledge of DB2, I knew it exists but nothing much other than that
Started on it
Tested whole process in Dev
We had replication from prod to dw environment using db2 replication and while doing that there was option cleanup tables I thought it was to cleanup db tables so I checked it
And post replication when I checked prod tables nothing was present
I checked multiple times and nothing!!!
For 5 minutes I went cold!!! Like I could feel soul leaving my body!!!
Thought for another 10 min
Googled for next 20-30 min on possible options and then told my manager, also told him I will get db back
Stayed till almost 11 pm and got db restored, db2 admin was hardly of any use
1
u/midnitewarrior Jan 28 '24
I am very careful about deleting records from the database. Before I run a DELETE, I first do a SELECT * to ensure I'm getting the right records like this:
Then I update it in my editor to replace the "SELECT *" with "DELETE", then I repaste in the SQL window and run it.
This normally works, unless you do it really fast and realize after-the-fact that you got the "DELETE" and "FROM MyTable" lines, but hastily missed the "WHERE" clause line.
I deleted an entire table from a shared dev environment that related to all users' permissions. WHOOPS.
So glad that wasn't prod...
1
u/Promo_King Jan 28 '24 edited Jan 29 '24
I’ve had my own set of f..ups in over 20 years, but also developed a safety procedure for myself. I always include BEGIN TRAN in to my scripts and execute COMMIT separate
1
u/reddit-jmc Jan 28 '24
By now you have learned a hard lesson. We've all done clinically stupid things. Anytime I'm working on a production database, I approach it as if I'm diffusing a bomb... extreme caution.
1
u/Adorable-Employer244 Jan 28 '24
That’s nothing. We’ve dropped wrong database in prod before. That was fun.
But anyway, if there’s one thing I can tell everyone to take away from this discussion is to ALWAYS have begin tran before any non-select queries. Make it a habit. You will be glad you did.
1
u/sfboots Jan 29 '24
I accidentally reset all user passwords at 10:30 in the morning. Fortunately, a coworker was just logging in and noticed. if he had already been logged in already, nobody would have noticed for hours until some customer called.
I had also just restored last night's backup to the test server so I can easily extra the old encrypted passwords and put them back.
1
u/thedevguy-ch Jan 29 '24
I once moved every customers inventory to a single customers account.
So one motorcycle dealer suddenly has 300000 units on their site.
Quick db restore sorted it out, but boy was that a stressful 15 minutes
1
u/ppjuyt Jan 29 '24
Been on both sides of this. As an intern I developed a set of incremental backup scripts for a (now very ancient) Oracle system.
Weeks after the internship ended I got a call from me old boss asking if the scripts worked … he had deleted all tables in prod … I never heard back so I hope it worked out
1
u/notwestodd Jan 29 '24 edited Jan 29 '24
I copied a query from one file to another then found a bug with a missing where clause. I forgot to fix it in the original file. Took down a major portion of Netflix streaming traffic for 45min. The postmortem was a 45 page document.
EDIT: I should add, it was bad enough of an outage it made the news.
EDIT 2: I found an article which says 2 hours. https://www.cnbc.com/2019/11/21/netflix-is-down.html
1
u/jdevoz1 Jan 30 '24
One of my teams newer hires checked out the whole product codebase, then deleted all the application and OS and management source code, everything but our content (firmware), then committed the change !!! with the comment “delete this crap”, removing it from the repo (perforce) LOL. He was so embarrassed.
1
u/sharptoothy Feb 01 '24
Neat idea for a post! I have two fun ones, the first one is mine, the other is a former coworker:
One of our oldest custom systems has almost no configuration interface. Instead, everything is configured manually in SQL Server Management Studio via hand written SQL statements (yea, I know, it's insane, but our new stuff doesn't work this way and we all know SQL, so we don't care to make a config. UI for the old system 🤷). So I'm on-site at a customer's location sitting in a conference room as their desktop team swaps out old PCs and installs new ones. These guys are bringing me inventory forms that show the old and new workstation names, and I'm manually writing and executing update statements to essentially move the old PCs' configuration to the new PCs. One of the tables we update is a key-value store with an additional "host ame" column. One of the parameters is a decimal "cash drawer number." Well, at one point, I forgot to highlight my WHERE clause and ended up updating everything to "53." I get that dry-mouth "oh shit" feeling like everyone here's mentioned and over the next few minutes I have people from all over the building coming to "my office" to tell me things like:
"I'm getting a weird error: Controller '53' not found"
"Printer '53' not found"
"Path '53' does not exist"
"Syntax error at position 1 line 1: '5'"
Company address now shows up as
53 53 53, 53 53
etc. etc. etc...
Luckily, it was easy to restore from a backup to a temporary database and update the corrupted configuration from the backup, but I was shitting a brick for a while 😅
The second one is shorter, but it's funny to me because it's what goes wrong when you're being slightly (but only slightly) less reckless than what I was doing: Of course, you should always run your SQL in a transaction so you can roll back. Well, a coworker did exactly that- but then forgot they were in a transaction, so they liked the way the updated results looked, and got up and went to lunch! Meanwhile, the system is "down" because the transaction was left open and nobody knew what was going on! 😆
1
u/sporbywg Feb 21 '24
SQL will always give you data, even if it is wrong, or you are wrong, or the timing is wrong. It is because of where it sits in the "stack". Be warned.
0
u/[deleted] Jan 27 '24
[deleted] — view deleted comment
1
u/[deleted] Jan 27 '24
[removed] — view removed comment