Re: Call Script from within a script

From: Louis Davidson (dr_dontspamme_sql_at_hotmail.com)
Date: 09/16/04


Date: Wed, 15 Sep 2004 20:11:28 -0400

Building stored procedures is the best way. Scripts are not known to SQL
Server. It is just a stream of characters coming in as batches that are
then executed.

What you might consider doing is to build your own script builder that you
use to precompile your scripts. Then send it to the query processor. It
wouldn't be too very hard to do, kind of a big replace operation.

-- 
----------------------------------------------------------------------------
Louis Davidson (drsql@hotmail.com)
Compass Technology Management
Pro SQL Server 2000 Database Design
http://www.apress.com/book/bookDisplay.html?bID=266
Note: Please reply to the newsgroups only unless you are
interested in consulting services.  All other replies will be ignored :)
"Martin" <NO_SPAMdavid1234@yahoo.com> wrote in message
news:uYN0PN3mEHA.2552@TK2MSFTNGP11.phx.gbl...
> Hi,
>
> I have two scripts
>
> SCRIPT_A and SCRIPT_B
>
> I always have to run SCRIPT_A BEFORE SCRIPT_B,
>
> however I sometimes run SCRIPT_A independently
>
> rather than place all code from SCRIPT_A inside SCRIPT_B and I would just
> like to have something like an include in SCRIPT_B that references
SCRIPT_A.
>
> I guess what I am looking for is the ability to "#include" in TSQL or an
> least run one script inside the other.
>
> cheers
>
> martin.
>
>
>


Relevant Pages

  • Re: Backup and restore - What is the preffered way?
    ... T-SQL scheduled using SQL Server Agent Service ... > Plus please post some links to backup command scripts pages. ...
    (microsoft.public.sqlserver.server)
  • Re: creating unique index and clustered index in sql server management studio
    ... Anything more should be done thru the Generate Scripts ... Andrew J. Kelly SQL MVP ... > SQL 2000 GUI created the indexes by creating a constraint while the new ... >>> Then the changes work and the code is genereted in the scripts. ...
    (microsoft.public.sqlserver.tools)
  • Re: Help Understanding mx.ODBC Error
    ... running the scripts on old data (that these scripts were able to digest ... Greg Corradini wrote: ... But recently they continue to bail on the mycursor.execute('An SQL ... Sent from the Python - python-list mailing list archive at Nabble.com. ...
    (comp.lang.python)
  • Re: Help Understanding mx.ODBC Error
    ... Greg Corradini wrote: ... I wrote two scripts using mx.ODBC on an Access DB. ... But recently they continue to bail on the mycursor.execute('An SQL ... I used the proper parameterization with "?" ...
    (comp.lang.python)
  • ActiveX scripts
    ... I have a reasonable knowledge of Visual Basic, but am completely new to SQL ... I am trying to write a few ActiveX scripts for use in DTS packages, ... Is it SQL server specific ActiveX, ...
    (microsoft.public.sqlserver.programming)