Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3695518
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:37:39+00:00 2026-05-19T04:37:39+00:00

I have this ant script which should create the table customer. I see the

  • 0

I have this ant script which should create the table customer. I see the message “Updating database…” so I know it’s being called, however when it hits the sql task, nothing is outputed and so I have difficulty understanding what went wrong. The “Upgrade complete.” message is never shown so I figure there was a fatal error somewhere.

I placed sqljdbc4.jar drivers with the other libraries in %ANT_HOME%/lib which are read without problems. If I knew where it was going wrong, I could at least search for a solution, but as it stands now I’m at the mercy of anyone who has had a similar problem. Surely it’s an obvious problem that I just can’t spot. Any input would be greatly appreciated.

The code for the task is below:

<!-- ================================= 
          target: execute-script        
         ================================= -->      
<target name="execute-script">
        <echo message="Updating database..." />
        <sql print="true" failOnConnectionError="true"
              driver="com.microsoft.sqlserver.jdbc.SQLServerDriver"
              url="jdbc:sqlserver://localhost:1433;DatabaseName=database;selectmethod=cursor"
              userid="ctsql"
              password="ctsqlone">
           <transaction>
              CREATE TABLE customer
                 (First_Name char(50),
                 Last_Name char(50),
                 Address char(50),
                 City char(50),
                 Country char(25),
                 Birth_Date datetime);              
           </transaction>
        </sql>
        <echo message="Upgrade complete." />
</target>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T04:37:39+00:00Added an answer on May 19, 2026 at 4:37 am

    You don’t normally issue DDL statements (create table and the like) within a transaction. Can you try removing the enclosing transaction?

    Sybase, for example, does not allow such statements raising the error:

    The 'CREATE TABLE' command is not allowed within a multi-statement transaction in the 'xxxxx' database.
    

    I don’t have a SQL Server instance to play with but would expect similar behaviour.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's suppose I have a valid Ant build script which packs up and prepares
I have an ANT script which will have a property whose value could be
I currently have this in my Ant build script: <exec dir=${basedir} executable=perl> <arg line=${basedir}/version.pl
I have an ant script which does lots of stuff but I have been
I'm translating an Ant script to Maven 2 and I have this problem: the
I have an Ant script which I run in Eclipse and it outputs in
I have a property file which is generated by my ant script itself during
I have these (sample) lines in a HTML-file: test.ABC.test test.ABCD.test test.ABCE.test And this Ant
I have seen this question about deploying to WebSphere using the WAS ant tasks.
I have a ruby application that executes ant as a subprocess using backtick. This

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.