RT# 76398 - fixed sybase query for detecting tables and adding columns