Calling SQL Scripts

  • We have a log of scripts that need to be running on a once and I would like to kwon if there is a way of running all the script from the one script? so that I only have to open on SQL script not 50 different scripts.

  • you could use a script that launches them all using xp_cmdshell with isql.

    e.g. exec xp_cmdshell 'isqlw -E -S myserver -d msdb -i "c:\sqlserver$\scripts\onlyonce_1.sql" -o "c:\sqlserver$\scripts\OutPut_onlyonce_1.sql" '

     

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

  • CREATE PROCEDURE spRunEmAll as

      EXEC spProc01

      EXEC spProc02

      EXEC spProc03

      EXEC spProc04

    etc...

    I would normally implement this sort of thing using .CMD files and the ISQL commandline interface.  I find it more convienant for schedluing, logging and interacting with other 'systems'.

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

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