Re: ADODB.Connection funkiness

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



NMAv wrote on Thu, 11 May 2006 23:03:01 -0700:

I've got an asp page that is used to update multiple databases residing on
multiple servers. We select which server/db combination to update and
submit and the all the SQL statements we've typed into the form are
processed. The problem is if we have something like this:

Insert into dumm(DUMMY1, DUMMY2)
SELECT 'XYZ','ABC';
GO
Insert into dumm(DUMMY1, DUMMY2)
SELECT 'PDQ,'DEF';
GO

ADO seems to freak out with the semicolon followed by the GO. If I remove
the semi colon the statement executes. If I remove the GO, the statements
execute. It is just when they are together that there is a problem. Why
is this? It doesn't happen in Query Analyzer. And more importantly is
there a fix or workaround? The SQL is created by a different process and
can be very large so doing away with the semicolon or the GO statement
would be difficult.

Looking to help, a direction, an intelligent explanation. Please.

GO is a batch delimiter in Query Analyzer, outside of that it has no
meaning. You can change it to something else in QA if you like. Just leave
out the GO's and it'll work as expected.

Dan


.



Relevant Pages

  • Re: XML Outputs
    ... I am executing these SQL statements in Query Analyzer. ... Can I not create XML documents interactively using Analyzer? ... > With best regards, Alex Shirshov. ...
    (microsoft.public.sqlserver.xml)
  • Re: SQL Server needs help from MS Access (or something)
    ... like is that you must save a view prior to running any SQL statements, ... unlike the query analyzer, which allows you to run code, and then just ... environment, a central repository, and works great in multi-database ...
    (comp.databases.ms-sqlserver)
  • Statement Help
    ... I have two SQL Statements that work great using Access as the front-end, but do not work at all using Query Analyzer as my front end. ... In Access the following two statements return the proper results (both statements accomplish the same thing - They both use a different technique to find unmatched records between two tables): ...
    (microsoft.public.sqlserver.programming)