SQL Transaction structure fixed