![]() Combining the two, we get the general-case solution: 'Do your updates in a transaction, with appropriate WHERE clauses to limit what they touch, and make sure the results look right before you commit': > BEGIN > UPDATE mytable SET foostring='NewValue' WHERE id > 16 AND id SELECT * FROM mytable > COMMIT - Or ROLLBACK if the SELECT doesn't look right. There is already a mechanism to safeguard your data when making changes (Transactions). There may or may not be such a thing in MS SQL, but why would you want this? There is already a way to limit what UPDATE affects (the WHERE clause). This command sets the following variables as well: sql_select_limit=1000 sql_max_join_size=1000000 I think sql_safe_updates is a unique variable by itself and has a great potential helping many developers. One would need to add 'safe-updates' command to my.cnf to turn it on. Mysql Set Sql Safe Updates 3,5/5 708 votes ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |