SQL registration, lots of sql stuff.