{"id":1902,"date":"2017-12-06T10:36:01","date_gmt":"2017-12-06T10:36:01","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/?p=1902"},"modified":"2021-02-27T09:30:36","modified_gmt":"2021-02-27T09:30:36","slug":"sql-files-execute-incorrect-syntax-near-go","status":"publish","type":"post","link":"https:\/\/www.scmgalaxy.com\/tutorials\/sql-files-execute-incorrect-syntax-near-go\/","title":{"rendered":"SQL files execute : Incorrect syntax near &#8216;go&#8217;."},"content":{"rendered":"<p><strong>saiki created the topic: SQL files execute : Incorrect syntax near &#8216;go&#8217;.<\/strong><br \/>\nGetting below issue when trying to run the ant script.<\/p>\n<p>I am trying to run few sql files from the folder through ant script in which I configured the &#8220;jtds-1.2.5.jar&#8221;.<br \/>\nUnable to run the GO statment in the sql file. But able to execute same file it through sql studio with out any error.<\/p>\n<p>************************************************** **<br \/>\n<target name=\"runscript\"><br \/>\n<sql driver=\"net.sourceforge.jtds.jdbc.Driver\"\nurl=\"jdbc:jtds:sqlserver:\/\/${xxxxx}:${1433}\/;\"\nuserid=\"${aaaaaaaa}\" password=\"${bbbbbb}\"\nclasspathref=\"jtds-1.2.5.jar\">\n<path>\n<fileset file=\"${basedir}\\source\\Mydata.sql\"\/>\n<\/path>\n<\/sql><br \/>\n<\/target><\/p>\n<p>************************************************** **<br \/>\nERROR:<br \/>\n************************************************** **<br \/>\njava.sql.SQLException: Incorrect syntax near &#8216;go&#8217;.<br \/>\nat net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnos tic(SQLDiagnostic.java:368)<br \/>\nat net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(Td sCore.java:2820)<br \/>\nat net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCor e.java:2258)<br \/>\nat net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(T dsCore.java:632)<br \/>\nat net.sourceforge.jtds.jdbc.JtdsStatement.processRes ults(JtdsStatement.java:584)<br \/>\nat net.sourceforge.jtds.jdbc.JtdsStatement.executeSQL (JtdsStatement.java:546)<br \/>\nat net.sourceforge.jtds.jdbc.JtdsStatement.executeImp l(JtdsStatement.java:723)<br \/>\nat net.sourceforge.jtds.jdbc.JtdsStatement.execute(Jt dsStatement.java:1160)<br \/>\nat org.apache.tools.ant.taskdefs.SQLExec.execSQL(SQLE xec.java:775)<br \/>\nat org.apache.tools.ant.taskdefs.SQLExec.runStatement s(SQLExec.java:751)<br \/>\nat org.apache.tools.ant.taskdefs.SQLExec$Transaction. runTransaction(SQLExec.java:1055)<br \/>\nat org.apache.tools.ant.taskdefs.SQLExec$Transaction. access$000(SQLExec.java:985)<br \/>\nat org.apache.tools.ant.taskdefs.SQLExec.execute(SQLE xec.java:653)<\/p>\n<p><strong>rajeshkumar replied the topic: Re: SQL files execute : Incorrect syntax near &#8216;go&#8217;.<\/strong><br \/>\nave you tried executing sql statement on command line. may be sql studio has some setting which is helping to get it execute but not the ant script.<\/p>\n<p>please refer these url as well&#8230;<br \/>\n<a href=\"http:\/\/forums.oracle.com\/forums\/thread.jspa?threadID=1323298\">forums.oracle.com\/forums\/thread.jspa?threadID=1323298 <\/a><br \/>\n<a href=\"http:\/\/stackoverflow.com\/questions\/6614544\/how-...on-using-jdbc-driver\">stackoverflow.com\/questions\/6614544\/how-&#8230;on-using-jdbc-driver<\/a><br \/>\nRegards,<br \/>\nRajesh Kumar<br \/>\nTwitt me @ <a href=\"http:\/\/twitter.com\/RajeshKumarIn\">twitter.com\/RajeshKumarIn<\/a><\/p>\n<p><strong>saiki replied the topic: Re: SQL files execute : Incorrect syntax near &#8216;go&#8217;.<\/strong><br \/>\nI Have set delimetr to GO in ant script<\/p>\n<p>Then it worked<\/p>\n","protected":false},"excerpt":{"rendered":"<p>saiki created the topic: SQL files execute : Incorrect syntax near &#8216;go&#8217;. Getting below issue when trying to run the [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[419],"tags":[421],"class_list":["post-1902","post","type-post","status-publish","format-standard","hentry","category-apache-ant-build-management-tools","tag-sql"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>SQL files execute : Incorrect syntax near &#039;go&#039;. - scmGalaxy<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.scmgalaxy.com\/tutorials\/sql-files-execute-incorrect-syntax-near-go\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SQL files execute : Incorrect syntax near &#039;go&#039;. - scmGalaxy\" \/>\n<meta property=\"og:description\" content=\"saiki created the topic: SQL files execute : Incorrect syntax near &#8216;go&#8217;. Getting below issue when trying to run the [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.scmgalaxy.com\/tutorials\/sql-files-execute-incorrect-syntax-near-go\/\" \/>\n<meta property=\"og:site_name\" content=\"scmGalaxy\" \/>\n<meta property=\"article:published_time\" content=\"2017-12-06T10:36:01+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-02-27T09:30:36+00:00\" \/>\n<meta name=\"author\" content=\"scmgalaxy K\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"scmgalaxy K\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/sql-files-execute-incorrect-syntax-near-go\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/sql-files-execute-incorrect-syntax-near-go\\\/\"},\"author\":{\"name\":\"scmgalaxy K\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/fc12ad190f540e79460243c81148d102\"},\"headline\":\"SQL files execute : Incorrect syntax near &#8216;go&#8217;.\",\"datePublished\":\"2017-12-06T10:36:01+00:00\",\"dateModified\":\"2021-02-27T09:30:36+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/sql-files-execute-incorrect-syntax-near-go\\\/\"},\"wordCount\":305,\"commentCount\":0,\"keywords\":[\"sql\"],\"articleSection\":[\"Apache Ant\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/sql-files-execute-incorrect-syntax-near-go\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/sql-files-execute-incorrect-syntax-near-go\\\/\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/sql-files-execute-incorrect-syntax-near-go\\\/\",\"name\":\"SQL files execute : Incorrect syntax near 'go'. - scmGalaxy\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#website\"},\"datePublished\":\"2017-12-06T10:36:01+00:00\",\"dateModified\":\"2021-02-27T09:30:36+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/fc12ad190f540e79460243c81148d102\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/sql-files-execute-incorrect-syntax-near-go\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/sql-files-execute-incorrect-syntax-near-go\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/sql-files-execute-incorrect-syntax-near-go\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SQL files execute : Incorrect syntax near &#8216;go&#8217;.\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#website\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/\",\"name\":\"scmGalaxy\",\"description\":\"A Platform for Software Engineers\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/fc12ad190f540e79460243c81148d102\",\"name\":\"scmgalaxy K\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g\",\"caption\":\"scmgalaxy K\"},\"sameAs\":[\"http:\\\/\\\/www.DevOpsSchool.com\"],\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/author\\\/scmgalaxy\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"SQL files execute : Incorrect syntax near 'go'. - scmGalaxy","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.scmgalaxy.com\/tutorials\/sql-files-execute-incorrect-syntax-near-go\/","og_locale":"en_US","og_type":"article","og_title":"SQL files execute : Incorrect syntax near 'go'. - scmGalaxy","og_description":"saiki created the topic: SQL files execute : Incorrect syntax near &#8216;go&#8217;. Getting below issue when trying to run the [&hellip;]","og_url":"https:\/\/www.scmgalaxy.com\/tutorials\/sql-files-execute-incorrect-syntax-near-go\/","og_site_name":"scmGalaxy","article_published_time":"2017-12-06T10:36:01+00:00","article_modified_time":"2021-02-27T09:30:36+00:00","author":"scmgalaxy K","twitter_card":"summary_large_image","twitter_misc":{"Written by":"scmgalaxy K","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/sql-files-execute-incorrect-syntax-near-go\/#article","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/sql-files-execute-incorrect-syntax-near-go\/"},"author":{"name":"scmgalaxy K","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/fc12ad190f540e79460243c81148d102"},"headline":"SQL files execute : Incorrect syntax near &#8216;go&#8217;.","datePublished":"2017-12-06T10:36:01+00:00","dateModified":"2021-02-27T09:30:36+00:00","mainEntityOfPage":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/sql-files-execute-incorrect-syntax-near-go\/"},"wordCount":305,"commentCount":0,"keywords":["sql"],"articleSection":["Apache Ant"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.scmgalaxy.com\/tutorials\/sql-files-execute-incorrect-syntax-near-go\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/sql-files-execute-incorrect-syntax-near-go\/","url":"https:\/\/www.scmgalaxy.com\/tutorials\/sql-files-execute-incorrect-syntax-near-go\/","name":"SQL files execute : Incorrect syntax near 'go'. - scmGalaxy","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#website"},"datePublished":"2017-12-06T10:36:01+00:00","dateModified":"2021-02-27T09:30:36+00:00","author":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/fc12ad190f540e79460243c81148d102"},"breadcrumb":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/sql-files-execute-incorrect-syntax-near-go\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.scmgalaxy.com\/tutorials\/sql-files-execute-incorrect-syntax-near-go\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/sql-files-execute-incorrect-syntax-near-go\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.scmgalaxy.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"SQL files execute : Incorrect syntax near &#8216;go&#8217;."}]},{"@type":"WebSite","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#website","url":"https:\/\/www.scmgalaxy.com\/tutorials\/","name":"scmGalaxy","description":"A Platform for Software Engineers","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.scmgalaxy.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/fc12ad190f540e79460243c81148d102","name":"scmgalaxy K","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g","caption":"scmgalaxy K"},"sameAs":["http:\/\/www.DevOpsSchool.com"],"url":"https:\/\/www.scmgalaxy.com\/tutorials\/author\/scmgalaxy\/"}]}},"_links":{"self":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/1902","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/comments?post=1902"}],"version-history":[{"count":1,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/1902\/revisions"}],"predecessor-version":[{"id":1903,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/1902\/revisions\/1903"}],"wp:attachment":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/media?parent=1902"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/categories?post=1902"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/tags?post=1902"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}