SQLSERVER Application Stored Proc Installation

  • Dear All,

    I need some advise on the best possible option for installing the application SPs in sqlserver. We have around 50 tables and 200+ SPs.

    An a part of continuous integration we would need to refresh the database that is droping and recreating everything: Table/Keys/SPs then insert the dummy data.

    As a part of this - I am using a .bat file and sqlcmd command to connect and feed the sqlfile.

    > type installer.bat

    sqlcomd -S " " -U "" -P "" -d "database_name" -i "C:\script1.sql"

    sqlcomd -S " " -U "" -P "" -d "database_name" -i "C:\script2.sql"

    sqlcomd -S " " -U "" -P "" -d "database_name" -i "C:\script3.sql"

    sqlcomd -S " " -U "" -P "" -d "database_name" -i "C:\script4.sql"

    ...

    ...

    Wondering if :

    1 ) there is a more efficient method for the same?

    2 ) Is there any way a report can be generated what are the SP's which is compiled with an error - that is a report of the installation.

    Thanks a lot in Advance.

    [font="Comic Sans MS"]--
    Sabya[/font]

  • In your DOS script, try something like this:

    IF %ERRORLEVEL%==1 ECHO *** Failure creating SP1 ***

    After each call of SQLCMD. We do something similar with OSQL (yes, I know it's been deprecated), although we stop the script there and then rather than running to the end.

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

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