Next Topic

Previous Topic

Book Contents

executeSqlQuery()

Note: A No Approved SQL message displays in the SQL Command to Execute drop-down list if no SQL commands have been manually added to the Kaseya Server, as described below.

Returns a value from the database and stores it to a named variable by running a selected SQL "query" statement. Global "query" statements are specified in the following location: <C:\Kaseya\xml\SDProcSQL\0\SQLQuery\<filename.xml>

Filenames can be any name with an .xml extension so long as they are formatted correctly internally. Multiple statements specified using one or more XML files display as a single combined combo box list in the user interface. Each SQL statement in the XML file has a unique label, and only the labels are shown in the combo box. If no SQL statements are defined, then *No Approved SQL* displays in the combo box.

Partition-Specific Statements

Partition-specific folders can contain partition-specific SQL statements. For example: <C:\Kaseya\xml\SDProcSQL\123456789\SQLQuery\<filename.xml>. Users can select and run all 0 folder SQL "query" statements and all SQL "query" statements located in the partition path that matches the partition they are using.

Example Format

<?xml version="1.0" encoding="utf-8" ?>
<queryList>
    <queryDef label="Agent Guid" sql="SELECT machName FROM dbo.machNameTab WHERE agentGuid = 12345678910111213141516171" />
</queryList>