Hi, does anyone know how to return a value from a (sql) database into an MSBuild script? I want to get the value into a property so I can pass it to subsequent build tasks.
I am fiddling round with something like the following at the moment, but this is returning -1 to indicate the query has executed successfully, whereas what I want is the actual result of the query. (SqlExecute from the community tasks).
<SqlExecute Command="select count(*) from dbo.trade"
ConnectionString="XXXX" >
<Output PropertyName="TradeCount" TaskParameter="Result" />
</SqlExecute>
<Message Text="$(TradeCount)" />