Removing dbname from queries