• Try this:

    @echo off

    if #%1# == ## goto noparm

    echo running %1

    echo ####################### running %1 #######################>>log.txt

    osql -U log.txt

    goto :done

    :noparm

    echo ####################### Start Process #######################>log.txt

    for %%X in (*.sql) do (call %0 %%X)

    echo ####################### End Process #######################>>log.txt

    start notepad log.txt

    :done

    Put all your script files into the same directory. How do you control the order they run in? Simple. By default NTFS directory results appear in alphabetic order 😎

    I wrote a Dot Net program that dumps tables as insert statements. I run that to export data and run this to do the imports. This way i avoid all the hassle of column order issues with BCP.

    ATBCharles Kincaid