Hello everyone.
This seems like a relatively simple thing to do, but for the life of me I
cannot figure out how to get this to work, or even if it is possible with
SQL Server (though it seems it ought to be).
What I would like to do is create one .SQL script file that I can load into
ISQL or ISQL/W that will iteratively call several other .SQL script files.
Specifically, we have script files to create all of the tables for our
schema -- I would like to create a 'master' creation script that calls each
of these individual ones. The idea here is that this way when doing a
clean installation the administrator only has to load one script file and
execute it.
In Oracle this is simple to do -- you just include a line in your script
and it will load and execute the script file indicated by <filename>.
Despite my best efforts at uncovering how this is to be done in SQL Server,
however, I can't seem to find any documentation that shows how this is
done!
I've thought about writing a script that calls xp_cmdshell with ISQL for
each of the script file, but of course I cannot seem to think of a way to
pass in the password as a command-line argument without first prompting the
user to type it in. Plus, this seems like a hokie way to implement such a
simple requirement.
Can anyone point me in the right direction here? Any help would be most
appreciated! Thanks in advance.
Stephen K.
--
+----------------------------------------------------------
| Stephen J. Konig
| Software Engineer
| Meridium Inc.
| Roanoke, Va.
|
| http://www.meridium.com
+----------------------------------------------------------