Re: loading sql files from a master file Oracle equivalent



Jeff Kish (jeff.kish@xxxxxxx) writes:
I need to give my customer an sql file that they can run in query
analyzer. All the stuff they need to run is in a set of existing files.
I'd like to just tell them to load this file (this is oracle syntax):


@file1.sql
@file2.sql
@file3.sql


is there some way of calling these files (that are in the same dir) from a
master sql file?

In Query Analyzer, no. In the command-line tool OSQL, yes. But I would
prefer to run each script from a separate OSQL invocation, and but that
in a .Bat file.

When you invoke OSQL, be sure to use the -I option to turn on the setting
QUOTED_IDENTIFIER which is off by default with OSQL.


--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx

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
.



Relevant Pages

  • Re: long SQL lines for osql
    ... It works great in Query ... Analyzer, but when run through osql it takes errors on lines that are ... One thing to keep in mind, is by default OSQL runs with QUOTED_IDENTIFIER ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ...
    (comp.databases.ms-sqlserver)
  • Re: Max query size in osql or management studio?
    ... Both osql and Management Studio throw an ... (for either osql or Management ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ... Books Online for SQL Server 2005 at ...
    (microsoft.public.sqlserver.tools)
  • Re: Password Change
    ... > In Osql you can use the sp_password system SP. ... > Books OnLine. ... > Dejan Sarka, SQL Server MVP ...
    (microsoft.public.sqlserver.security)
  • Re: Query Analyzer in Sql Server 2005
    ... So which edition of Sql Server 2005 I need to install to have Query ... Analyzer on my machine? ... Books Online for SQL Server 2005 at ...
    (microsoft.public.sqlserver.tools)
  • Re: call script from another script
    ... As I recall,:r works in OSQL as well. ... And OSQL comes with SQL 2000. ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ... Books Online for SQL Server 2005 at ...
    (comp.databases.ms-sqlserver)