how to give multiple server names at a time in osql commands

  • osql -S"servername" -Uusername-Ppassword -dmsdb -ijob_stop.sql -olog.txt

    type log.txt>>finallog.txt"

    by using the above command we can only stop the one server job at a time. But i want to execute this for multiple servers at the same time. is there any solution for that one.

  • Nope.. Sorry..

    CEWII

  • write a batch file one osql per server...

    osql -S"server1" -Uusername-Ppassword -dmsdb -ijob_stop.sql -olog.txt

    type log.txt>>finallog.txt"

    osql -S"server2" -Uusername-Ppassword -dmsdb -ijob_stop.sql -olog.txt

    type log.txt>>finallog.txt"

    osql -S"server3" -Uusername-Ppassword -dmsdb -ijob_stop.sql -olog.txt

    type log.txt>>finallog.txt"

    osql -S"server4" -Uusername-Ppassword -dmsdb -ijob_stop.sql -olog.txt

    type log.txt>>finallog.txt"

Viewing 3 posts - 1 through 2 (of 2 total)

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