Fixed sqlscript to be a true script