• Nice script! As an alternate workaround you could also make use of bcp command.

    Thanks

    Amol Naik