General statistics
List of Youtube channels
Youtube commenter search
Distinguished comments
About
xybersurfer
ThePrimeTime
comments
Comments by "xybersurfer" (@xybersurfer) on "How I Destroyed My Company's DB" video.
the problem is that you don't know which records were already false. so changing them all to true is as bad as changing them all to false
3
because he also changed all records (including those with the wrong id), and he doesn't know what their original value is supposed to be
2
exactly my thoughts. doing it with the GUI should be the first thought
2
@EdmondDantèsDE right. maybe "one of the first thoughts" is a better way to put it
2
marking it is exactly what he did though. he just marked too much
2
yep lol. thinking you can write code without a mistake
1
he doesn't know whether those were originally all false
1
this is exactly the right way to do it. but, i even avoid writing these scripts if i can, by using the database editor to edit records manually
1
@nchomey i hope this helps. it's an example for Microsoft SQL Server (using Management Studio): BEGIN TRANSACTION; DELETE FROM Employee WHERE DepartmentID = 13; ROLLBACK; -- cancel changes then it automatically shows a message with the number of rows affected. if the number of rows in the message looks OK, then you can now replace ROLLBACK with COMMIT and run it again to make it permanent: BEGIN TRANSACTION; DELETE FROM Employee WHERE DepartmentID = 13; COMMIT; -- save changes or if like me, you want to actually see the actual resulting data first instead of just the number of rows affected, then you can add a SELECT after the DELETE statement in the transaction and do the same: BEGIN TRANSACTION; DELETE FROM Employee WHERE DepartmentID = 13; SELECT * FROM Employee; -- to see what the data would look like after the DELETE ROLLBACK; -- cancel changes
1
technically it started with the corrupt orders. but yeah it's mostly that person
1