Re: Why can't I execute this script in ADO?
From: Martijn Tonies (m.tonies_at_upscene!nospam!.com)
Date: 01/26/04
- Next message: Mark: "Using Delphi 7 ADO to access SQL Server accross a WAN"
- Previous message: Petar Petrovic: "Re: Why can't I execute this script in ADO?"
- In reply to: Petar Petrovic: "Re: Why can't I execute this script in ADO?"
- Next in thread: Lee Grissom: "Re: Why can't I execute this script in ADO?"
- Reply: Lee Grissom: "Re: Why can't I execute this script in ADO?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 26 Jan 2004 22:53:19 +0100
Hi Petar,
> > > Thanks man. However, it would be nice to find a way to execute a
script
> > > files generated for/by SQL Server.
> > > I understand that "GO" has nothing to do with SQL standard, but
still...
> >
> > Even more, it has nothing to do with MS SQL Server. Read the
> > "books online" about "GO" -> it explicitly states that GO is a client
> > tool thing.
>
> Hmm, yes, this sucks... BTW, if it is of no secret, how did you (if you
did)
> solve those problems in Database Workbench?
> I checked your great tool, though I saw that you have two ways of SQL
> statements executing...
The "SQL" tab is to execute a single statement and it checks
for parameters (: in the sql statement, like with Delphi) and
can return a dataset, while the "Script" tab accepts a script
with "GO" items in it. For each "GO", Database Workbench
executes the lines it has collected from the script so far.
Basically:
script := '';
n := 0;
while n < lines.Count
do begin
if UpperCase(lines[n]) <> 'GO'
then script := script + lines[n] + #10#13
else begin
execute_the_statement(script);
script := '';
end;
Inc(n);
end;
(although a bit more complex). So I'm handling the "GO" at
the client side as well :-)
-- With regards, Martijn Tonies Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL Server. Upscene Productions http://www.upscene.com
- Next message: Mark: "Using Delphi 7 ADO to access SQL Server accross a WAN"
- Previous message: Petar Petrovic: "Re: Why can't I execute this script in ADO?"
- In reply to: Petar Petrovic: "Re: Why can't I execute this script in ADO?"
- Next in thread: Lee Grissom: "Re: Why can't I execute this script in ADO?"
- Reply: Lee Grissom: "Re: Why can't I execute this script in ADO?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|