previewSql function

Preview SQL statement