Moved sql out of server script.