Any way to see or view the results of an execute sql task ?

  • We have the following in a bat file:

    REM This BAT file uses the userid and password of the account that is running the BAT file.

    REM %1 = SQLServer name

    REM %2 = database

    REM %3 = path to .sql and .log files folder

    REM %4 = file name w/o the file extension for .sql and .log files

    osql -S %1 -E -d %2 -i "%3%4.sql" -o "%3%4.log" -b

    We have another version that requires username and password.

    In SSIS we send the 'varaiables' this needs in the Arguments part of the execute process task and the Executable portion points to this bat file.

    Let me know if you need more than this.

    -------------------------------------------------------------
    we travel not to escape life but for life not to escape us
    Don't fear failure, fear regret.

  • below86 (10/30/2013)


    ...

    osql -S %1 -E -d %2 -i "%3%4.sql" -o "%3%4.log" -b

    ...

    Just for your information:

    osql is deprecated (and it has some issues. I remember it not working with utf8 files are something like that.)

    You can replace it with sqlcmd.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Koen Verbeeck (10/30/2013)


    below86 (10/30/2013)


    ...

    osql -S %1 -E -d %2 -i "%3%4.sql" -o "%3%4.log" -b

    ...

    Just for your information:

    osql is deprecated (and it has some issues. I remember it not working with utf8 files are something like that.)

    You can replace it with sqlcmd.

    Thanks for the info, I'll keep it in mind if we start to see issues.

    -------------------------------------------------------------
    we travel not to escape life but for life not to escape us
    Don't fear failure, fear regret.

Viewing 3 posts - 16 through 17 (of 17 total)

You must be logged in to reply to this topic. Login to reply