Restored the sql stuff as it is needed.