performance - Database: get and delete or just delete? -
Performance / Good Practice Questions - Should I check that the object exists or just delete it?
therefore:
obj = getObj (someid); If (obj! = Null) {deleteObj (someId); } Or simply:
deleteObj (someId); ?
From a demonstration perspective, you might be better off trying to remove the record id vs. record And then trying to return it to the database to remove it. There is always good practice to limit the number of transactions on your database.
Remove from table name where id = @ id You will know whether you have deleted any records based on the row count above Returned to the given question.
Comments
Post a Comment