Trouble with Sql Check

Oct 3, 2013 at 10:04 PM
I've downloaded the 2.4 binaries and am having trouble with the SqlScalarCheck. No matter what I put in the FromQuery (FROM MyTable), it insists on throwing an error saying that "The FromQuery config property is badly formed; it must start with 'FROM'". I tried download the source to figure out the problem, but the source doesn't even contain a SqlScalarCheck - just a SqlQueryCheck, which is a bit different.

So I guess, I've got a couple of problems - how do you use the SqlScalarCheck and why does the source not match the released code? Is the source for one of the previous releases?

Overall I'm impressed and am considering writing some of my own checks (a SqlThresholdCheck for starters).
Oct 3, 2013 at 10:56 PM

The source is the current v3 code base - to get the source that goes with v2.4 you would need to look through the commit history and use the HG exe to rewind back to that version.

On to your issue with the SQL check... Can you post the configuration XML you are using for this check (please sanitise server names etc first)?

Basically the check just adds the "SELECT *" to the From configuration value you supply, eg: "FROM SomeTable WHERE Something > 10"

Hopefully this is just a configuration issue.

Glad you like it - and if you need any assistance writing additional checks then let me know.


Oct 4, 2013 at 5:26 PM
Thanks for the quick reply. I'll have to learn about the HG tool.

I figured out what I was doing wrong in the FromQuery. My value was "FROM MyTable WHERE some criteria" which I had copied from Sql Management Studio. I didn't realize that I actually had a TAB between FROM and MyTable (it looked just like a space). The source code actually checks for StartsWith("FROM ") with a space character following the FROM. I didn't realize it until I pasted my XML into this message to respond and the formatting of codeplex's message system showed it as a TAB.