Re: Running Sql-Server Generated Script files through an SqlCommand-Object

From: Matthias Steinbart (postamt_at__REMOVEME_emvoid.de)
Date: 07/19/04


Date: Mon, 19 Jul 2004 20:21:45 +0200

Hi Bruce,

thanks for the reply. Could you please provide some more detail? Why do I
have to parse for the GO? Does this mean I have to run a SqlCommand for each
section that ends with "GO"?

As for the Print and Error events. Could you please shortly provide info on
where to hook up on these events? I can't find any of those neither in the
SqlCommand nor in the Sql Connection objects.

Thanks for your help!

Matthias

--
-----
fragmente einer flugbahn - http://emvoid.de
"bruce barker" <nospam_brubar@safeco.com> schrieb im Newsbeitrag
news:#8MW5lbbEHA.644@tk2msftngp13.phx.gbl...
> sure, just parse for the go as a batch delimiter. also catch print and
error
> events.
>
> -- bruce (sqlwork.com)
>
>
> "Matthias Steinbart" <postamt@_REMOVEME_emvoid.de> wrote in message
> news:u0%23Y9LbbEHA.996@TK2MSFTNGP12.phx.gbl...
> > Hi there,
> >
> > I have generated some SQL script-files using the SQL-Enterprise Manager
> (for
> > creation of tables, stored procedures, etc.).
> >
> > When running those script files through the isql or osql utility, I have
> the
> > possibility to capture the output to a file, which is sort of importand
to
> > me.
> >
> > What I'd like to do is to write a small utility (Windows app in c#)
which
> > will execute my sql-script-files on the SQL server. Again, I need to
> capture
> > the output. Can this be done using an SqlCommand-object providing the
> > contents of each individual script-file as the command text or do I have
> to
> > use isql. In both ways I'd like to know how it is possible to capture
the
> > output.
> >
> > The output is actually only required if there have been errors during
> > batch-execution.
> >
> > Any help is greatly appreceated. Thanks in advance.
> >
> > Matthias
> >
> > --
> > -----
> > fragmente einer flugbahn - http://emvoid.de
> >
> >
> >
> >
> >
>
>


Relevant Pages

  • Re: Library Cache
    ... procedures that determines the SQL to be submitted based on the ... These statements would all use bind variables. ... query string to parse, whereas: ... it's HOW and WHEN that replacement occurs. ...
    (comp.databases.oracle.server)
  • Re: Library Cache
    ... procedures that determines the SQL to be submitted based on the ... These statements would all use bind variables. ... query string to parse, whereas: ... it's HOW and WHEN that replacement occurs. ...
    (comp.databases.oracle.server)
  • Re: Library Cache
    ... procedures that determines the SQL to be submitted based on the ... query string to parse, whereas: ... it's HOW and WHEN that replacement occurs. ...
    (comp.databases.oracle.server)
  • Re: Library Cache
    ... procedures that determines the SQL to be submitted based on the ... These statements would all use bind variables. ... query string to parse, whereas: ... it's HOW and WHEN that replacement occurs. ...
    (comp.databases.oracle.server)
  • Re: Advanced? Parsing Methods
    ... >and writes new records to a table in a SQL Server 2000 database. ... > there is a more efficient/advanced way to parse the data before I pass it ... have to put the results into an array. ... You can see the above recordset is MUCH cleaner then the sql stamntet. ...
    (microsoft.public.access.modulesdaovba)