February 4, 2010 at 3:17 am
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
February 4, 2010 at 3:43 am
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
February 24, 2010 at 2:56 am
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.
March 2, 2010 at 4:16 am
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