Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Your problem is (of course) in line</p> <pre><code>&lt;exec program="${SqlCmd}" commandline="-S ${SqlServerInstanceName} -E -d HBus -i ${SqlBuildScriptsDir}${sqlBuildFileName} -v vSchemaVersion=${buildHistoryContents} " /&gt; </code></pre> <p>specifically, in </p> <pre><code>-v vSchemaVersion=${buildHistoryContents} </code></pre> <p>The NAnt expression replaces property ${buildHistoryContents} with the stored value--which will include any embedded spaces. Problem is, when calling SQLCMD (I"m assuming that's what ${SqlCmd} resolves to) from a command window, the values for any and all -v parameters are space delimited -- that is, the parser hits -v, reads the next characters through the "=" as the variable name, then reads all characters after the = and through the next space (or end of line) as the value to assign to the variable, and that embedded space will mess you up bigtime.</p> <p>On the command line, the work-around is to wrap the variable value in quotes:</p> <pre><code> - v MyVariable=Hello World </code></pre> <p>becomes</p> <pre><code> - v MyVariable="Hello World" </code></pre> <p>That doesn't work here, because it's XML and you have to wrap the <em>commandline</em> attribute of the <em>exec</em> element with quotes... and embedded quotes will, once again, mess you up bigtime.</p> <p>I believe the work-around here is to use XML macro substitution (I quite possibly have the formal titles of these concepts wrong) for those embedded quotes. This value should be </p> <pre><code>&amp;quot; </code></pre> <p>Which means that the following should work:</p> <pre><code>&lt;exec program="${SqlCmd}" commandline="-S ${SqlServerInstanceName} -E -d HBus -i ${SqlBuildScriptsDir}${sqlBuildFileName} -v vSchemaVersion=&amp;quot;${buildHistoryContents}&amp;quot; " /&gt; </code></pre> <p>Please try this and see -- I may have to do something like this myself some day soon.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload