This project is read-only.

SqlCmd output

Nov 29, 2009 at 5:14 PM

Can I output the result of a SqlCmd to a variable of msbuild instead of a file?

Dec 1, 2009 at 1:00 PM

No, you would have to use the ReadLinesFromFile task



Dec 1, 2009 at 1:09 PM

Thx Mike, I had figured out about ReadLines.

I think it would be greeat for some scenarios.

Image having to read a file every time you need to output a scalar value.

Is there a features it, I could put this in?

Dec 4, 2009 at 4:56 PM

Hi Yvan, feel free to submit a patch where you have this working.



Jan 7, 2010 at 1:44 PM
Edited Jan 7, 2010 at 4:08 PM

I am having some trouble figuring out how to use it. I am doing a select statement to an out file and the results of the file are:


(1 rows affected)






(1 rows affected)

How can I read that in but know to only get the line with the version number in it? I'm fairly new to MSBuild and haven't been able to find any documentation on picking certain array elements.



Jan 11, 2010 at 10:25 AM

Use the SqlExecute task rather. It's shipping in, but is checked in now if you want to build it locally.

Draft documentation here: