While using CRM 4.0 many times we have to do unsupported changes directly to the database and there is risk involved in running the queries directly to change CRM database record or field.
I have small tip for this using SQL Transaction for this. Before running your Query run
begin transaction Command then run your query and check the results.
If results are ok and as expected then run
commit transaction Command.
Otherwise if result is not as expected then run
rollback transaction Command and that will undo the changes.
see below image for explnation on this..
Hope this helps!!!