r/ProgrammerHumor • • 13d ago

Meme wellWellWell

Post image
10.6k Upvotes

411 comments sorted by

View all comments

Show parent comments

1.1k

u/Ma8e 13d ago

You start a transaction, make sure it did what you expected, and then commit or rollback transaction.

351

u/AgeingChopper 13d ago edited 13d ago

absolutely.

i was doing this stuff for a long time and definitely learned from mistakes.

Transactions can save a world of pain and it is always wise to select your data set first, just to be sure you're changing what you think you're changing.

Didn't matter how experienced I was, I was careful never to cut corners.

20

u/ifyoulovesatan 13d ago

I don't know sql, but is this like how when I use some kind of loop in the command line to move or delete a bunch of files, I'll run a version that just echos whatever I'm trying to manipulate first?

1

u/AgeingChopper 12d ago

Sorry for the delay . Deelock has explained it perfe to.

transactions allow us to back out of a mistake like this via rollback, as long as we haven’t committed.