Fix sql error on netdiscovery. closes #2502