Update SQL support to be not quite so dumb