Removing sql query -refs #6213