SQL check: illegal character