Advertisement

06.04.2008 at 12:37PM PDT, ID: 23458076
[x]
Attachment Details

Incorrect syntax near 'GO'  running SQL Server 2000 Script in vb.net

Asked by sny23vpb in Visual Studio, MS SQL Server, Microsoft Visual Basic.Net

I am trying to write a vb.net process to create stored procedures from vss files.
They all contain multiple 'GO' statements in the script.

Everything is great till it hits the 'go' command.  I'm using SQL Server 2000
I can't really strip the go out of all the VSS code. Any thoughts would be greatly appreciated.

--------------------

Code similar to the following:
e.g.

    strFileContents = My.Computer.FileSystem.ReadAllText("c:test.sql")
            connection.Open()
                   

            sql = strFileContents
'Example: CREATE PROCEDURE dbo.sp_mysp  as update table set field = 50   GO

            myCommand = New SqlCommand(Sql, connection)
            ra = myCommand.ExecuteNonQuery()  <<< Errors right here unless I take out the "GO"Start Free Trial
[+][-]06.04.2008 at 12:41PM PDT, ID: 21713417

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.04.2008 at 12:41PM PDT, ID: 21713427

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.04.2008 at 12:46PM PDT, ID: 21713460

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.04.2008 at 01:04PM PDT, ID: 21713623

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.04.2008 at 01:08PM PDT, ID: 21713656

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.04.2008 at 01:10PM PDT, ID: 21713665

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.04.2008 at 01:15PM PDT, ID: 21713726

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.04.2008 at 01:17PM PDT, ID: 21713737

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Visual Studio, MS SQL Server, Microsoft Visual Basic.Net
Sign Up Now!
Solution Provided By: angelIII
Participating Experts: 2
Solution Grade: A
 
 
[+][-]06.04.2008 at 01:18PM PDT, ID: 21713753

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.04.2008 at 01:32PM PDT, ID: 21713880

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.04.2008 at 01:35PM PDT, ID: 21713903

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.04.2008 at 01:39PM PDT, ID: 21713932

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628