Below is the script for finding high water mark of a table.