Re: Parse SQL script

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Val Mazur (group51a_at_hotmail.com)
Date: 05/28/04


Date: Thu, 27 May 2004 21:54:00 -0400

Hi Pablo,

Since you cannot execute batches with the GO statements you have a several
ways to do this.
One is to execute SQL statements one-by-one. Another way, which will work
only with the OLEDB Provider for SQL Server, is to remove all GO statements,
separate your statements inside of the batch with the semicolon and execute
this separated string in one shot.

-- 
Val Mazur
Microsoft MVP
"Pablo Garateguy" <anonymous@discussions.microsoft.com> wrote in message 
news:DAA39A49-ED25-456D-ACF0-B17811CB9960@microsoft.com...
> How can I parse an SQL script (like script to create a database)?
> 


Relevant Pages

  • Re: Update 300 DBs with .sql file
    ... -- big SQL Script here' FROM master..sysdatabases ... use a where clause to exclude databases, ... behavior of this view is changing in SQL Server 2005 and it will no longer ... > database, use that database, and execute the long string statement. ...
    (microsoft.public.sqlserver.server)
  • Re: Opinions on approach, please...
    ... Create a data layer program per table, ... number of bind variable tokens in your dynamic SQL. ... then simply EXECUTE that without passing it any parameters? ... Hard code WHERE clauses. ...
    (comp.lang.cobol)
  • Re: SQL Injection- Bypassing magic_quotes
    ... Because i was trying to execute: ... Don't terminate the query and you most ... Or try something like bobcat or one of the other SQL injection tools out ... Chief Information Security Officer ...
    (Pen-Test)
  • Re: Opinions on approach, please...
    ... Create a data layer program per table, ... number of bind variable tokens in your dynamic SQL. ... then simply EXECUTE that without passing it any parameters? ... explicitly code dummy words as bind variable placekeepers, put the host variables on the ...
    (comp.lang.cobol)
  • Re: UPDATE query in Access 2003 raising error
    ... string into a variable strSQL but create the qrydef from a string strSQLx (I ... Runtime error 3066 Query must have at least one destination field. ... The SQL works fine if I use it in the QBF Design mode. ... Elsewhere in the code I use the same technique to execute an SQL ...
    (microsoft.public.access.formscoding)