I just spotted some more small stuff:
s/IF NOT EXIST /IF NOT EXISTS /g # 2 x
It actually had me doubting, but yes that -S should be there...
Thanks,
Erik Rijkers