Is it poossible that all you are doing is just running the SELECT, and not the script generated by the SELECT?