switch sql to cm