Fixed the wrong exception type in SQL table tests