Home All Groups Group Topic Archive Search About

execute *.sql in command line

Author
31 Mar 2006 6:46 AM
Filip De Backer
Hi everyone,

I want to execute more than 30 sql files in the command line.

isqlw -d DatabaseName -E -f "*.sql"
    ---> this opens all the sql files in the query analyser.

isql -d DatabaseName -E -i "*.sql"
    ---> this doesn't work

what can I do to automatically execute all the sql file in the commandline.
each sql file contains an alter procedure statement

thanks!

Filip De backer

Author
31 Mar 2006 7:29 AM
Erland Sommarskog
Filip De Backer (filip_de_bac***@hotmail.com.(donotspam)) writes:
> I want to execute more than 30 sql files in the command line.
>
> isqlw -d DatabaseName -E -f "*.sql"
>     ---> this opens all the sql files in the query analyser.
>
> isql -d DatabaseName -E -i "*.sql"
>     ---> this doesn't work
>
> what can I do to automatically execute all the sql file in the
> commandline. each sql file contains an alter procedure statement

If you are on Windows XP, open Help and Support Centre, and go to the
Tools section, and navigate down to command-line commands. I believe
you can do this with the FOR command.


--
Erland Sommarskog, SQL Server MVP, esq***@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

AddThis Social Bookmark Button