Showing posts with label approximately. Show all posts
Showing posts with label approximately. Show all posts

Wednesday, March 7, 2012

Run all .sql files in a folder

I have created scripts to create approximately 200 tables. I have all of
these .sql files saved in a folder on a server. Is there a way to execute o
r
run all of the files at once in this folder instead of running them one at a
time?
ThanksYou could write a batch file - use a 'for' loop and call osql passing the
file path and other appropriate parameters.
"bbasile" wrote:

> I have created scripts to create approximately 200 tables. I have all of
> these .sql files saved in a folder on a server. Is there a way to execute
or
> run all of the files at once in this folder instead of running them one at
a
> time?
> Thanks|||Sounds good. Are there any examples out there I could take a look at?
"KH" wrote:
> You could write a batch file - use a 'for' loop and call osql passing the
> file path and other appropriate parameters.
>
> "bbasile" wrote:
>|||that's exactly what I was going to suggest.
another way would be to use the OA methods and FileSystemObjects to load
each of the files and then execute them.
> You could write a batch file - use a 'for' loop and call osql passing the
> file path and other appropriate parameters.
>
> "bbasile" wrote:
>
new