execute multiple stored procedure at once

  • i have a database in which around 700 stored procedure in 140 sql files and now i want to execute all this files.

    is there any way to execute all this at once through batch or something like that?

    thanks

  • What about sqlcmd?

    You could provide the script name through the -i argument.

    If you are working with SQL Server 2000/7 there's OSQL that works quite the same way.

    -- Gianluca Sartori

  • SSIS? If there is no flow specified they will all start execution at the same time? Or maybe use a sequence container to execute in batches.

  • Create a batch file and add the below content (Replace all the values e.g. SQL Server name, user Id, Pwd)

    ----------------------------

    setlocal

    SET SQLCMD=sqlcmd -S SERVERNAME -U LOGINID -P PASSWORD -d DATABASE NAME

    for %%d in (*.sql) do %SQLCMD% -i%%d

    endlocal

    ----------------------------

    Keep this bat file in a folder where you want to excute all the sql files. Run the batch file. It will excute all the scripts (no need of manual excution of files).

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

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