I wouldnt nest the select query as you cant really error trap that I would rather do the query and if there is a result do the insert, if the insert happens do the delete, all the way through you can...