[mssql][ant] Failed to execute: GO

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • maciek zywno

    [mssql][ant] Failed to execute: GO

    Hi,

    I am trying to execute a simple sql file thru ant task. The file is:

    use [centivaTest]
    GO

    However I get the errror message:
    [sql] Failed to execute: use [centivaTest] GO

    So I changed the file to:

    use [centivaTest] ;
    GO

    as ant treats ';' as a delimiter. However another erro message
    appears:

    [mssql][ant] Failed to execute: GO

    Do you know how to execute my simple sql statements thru ant (or
    generally what wrong am I doing)?

    Best regards,
    Maciek Zywno
  • Craig Kelly

    #2
    Re: [mssql][ant] Failed to execute: GO

    "maciek zywno" wrote:
    [color=blue]
    > I am trying to execute a simple sql file thru ant task. The file is:[/color]

    <snip>
    [color=blue]
    > However I get the errror message:
    > [sql] Failed to execute: use [centivaTest] GO[/color]

    Maciek,

    GO isn't understood by SQL Server: it's used as a batch delimiter for isql,
    osql, and QA. I'm not an ant expert, but a few choices I see are:

    - Have ant execute your SQL file via osql.

    - Removed unnecessary GO's and/or manually break your script into separate
    scripts (since that's what GO does anyway).

    Craig


    Comment

    Working...