{"id":1036,"date":"2013-07-12T09:30:04","date_gmt":"2013-07-11T23:30:04","guid":{"rendered":"http:\/\/ntsblog.homedev.com.au\/?p=1036"},"modified":"2013-07-12T09:30:04","modified_gmt":"2013-07-11T23:30:04","slug":"post-deployment-script-72006-fatal-scripting-error-incorrect-syntax-encountered-parsing","status":"publish","type":"post","link":"https:\/\/ntsblog.homedev.com.au\/index.php\/2013\/07\/12\/post-deployment-script-72006-fatal-scripting-error-incorrect-syntax-encountered-parsing\/","title":{"rendered":"Post Deployment Script, 72006: Fatal scripting error: Incorrect syntax was encountered while parsing"},"content":{"rendered":"<div id=\"ntsbl-3734282648\" class=\"ntsbl-before-content ntsbl-entity-placement\"><script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-6288941070289539\" crossorigin=\"anonymous\"><\/script><ins class=\"adsbygoogle\" style=\"display:inline-block;width:728px;height:90px;\" \ndata-ad-client=\"ca-pub-6288941070289539\" \ndata-ad-slot=\"9356781486\"><\/ins> \n<script> \n(adsbygoogle = window.adsbygoogle || []).push({}); \n<\/script>\n<\/div><h2>The Problem<\/h2>\n<p>You create a post deployment script, with a statement like;<br \/>\n[sql]<br \/>\n:r .\\Static Data\\Insert Seed Values.sql<br \/>\n[\/sql]<\/p>\n<p>The system throws an error and will not build:<br \/>\n[csharp][\/csharp]<br \/>\n72006: Fatal scripting error: Incorrect syntax was encountered while parsing &#8216;Data\\Insert&#8217;<br \/>\n[\/chsharp]<\/p>\n<h2>The solution<\/h2>\n<p>There are two problems:<\/p>\n<ol>\n<li>The post deployment script does not like spaces in the file paths, so quote the file path in &#8220;double quotes&#8221;.<br \/>\n[sql]<br \/>\n:r &quot;.\\Static Data\\Insert Seed Values.sql&quot;<br \/>\n[\/sql]\n<\/li>\n<li>The post deployment script runs in SQL CMD mode, so whilst ever you have the script file open it will throw syntax errors either\n<ol>\n<li>Close the post deployment script; or<\/li>\n<li>Turn on SQL CMD mode on the file, (in 2012 with latest SSDT this is the last icon in the toolbar <\/br><br \/>\n<a href=\"https:\/\/ntsblog.homedev.com.au\/wp-content\/uploads\/2013\/07\/SQLToolbar.png\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1037\" data-permalink=\"https:\/\/ntsblog.homedev.com.au\/index.php\/2013\/07\/12\/post-deployment-script-72006-fatal-scripting-error-incorrect-syntax-encountered-parsing\/sqltoolbar\/\" data-orig-file=\"https:\/\/ntsblog.homedev.com.au\/wp-content\/uploads\/2013\/07\/SQLToolbar.png\" data-orig-size=\"485,29\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"SQLToolbar\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/ntsblog.homedev.com.au\/wp-content\/uploads\/2013\/07\/SQLToolbar-300x17.png\" data-large-file=\"https:\/\/ntsblog.homedev.com.au\/wp-content\/uploads\/2013\/07\/SQLToolbar.png\" src=\"https:\/\/ntsblog.homedev.com.au\/wp-content\/uploads\/2013\/07\/SQLToolbar.png\" alt=\"SQLToolbar\" width=\"485\" height=\"29\" class=\"aligncenter size-full wp-image-1037\" srcset=\"https:\/\/ntsblog.homedev.com.au\/wp-content\/uploads\/2013\/07\/SQLToolbar.png 485w, https:\/\/ntsblog.homedev.com.au\/wp-content\/uploads\/2013\/07\/SQLToolbar-300x17.png 300w\" sizes=\"auto, (max-width: 485px) 100vw, 485px\" \/><\/a>\n<\/li>\n<\/ol>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>The Problem You create a post deployment script, with a statement like; [sql] :r .\\Static Data\\Insert Seed Values.sql [\/sql] The system throws an error and [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[13,26,14],"tags":[],"class_list":["post-1036","post","type-post","status-publish","format-standard","hentry","category-sql-server","category-ssdt","category-visual-studio"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ntsblog.homedev.com.au\/index.php\/wp-json\/wp\/v2\/posts\/1036","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ntsblog.homedev.com.au\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ntsblog.homedev.com.au\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ntsblog.homedev.com.au\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ntsblog.homedev.com.au\/index.php\/wp-json\/wp\/v2\/comments?post=1036"}],"version-history":[{"count":0,"href":"https:\/\/ntsblog.homedev.com.au\/index.php\/wp-json\/wp\/v2\/posts\/1036\/revisions"}],"wp:attachment":[{"href":"https:\/\/ntsblog.homedev.com.au\/index.php\/wp-json\/wp\/v2\/media?parent=1036"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ntsblog.homedev.com.au\/index.php\/wp-json\/wp\/v2\/categories?post=1036"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ntsblog.homedev.com.au\/index.php\/wp-json\/wp\/v2\/tags?post=1036"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}