Kaseya Community

Servicedesk Procedure SQLQuery

  • Hello,


    I have an SQLQuery in XML format and want to use this in a servicedesk procedure.
    Where should i save the xml file on the Kaseya server? (Kaseya Version 9.2 )

    Thanks.

  • I already found the location:

    Kaseya\xml\SDProcSQL\0\SQLQuery

    I don't had the folder SDProcSQL, so had to add this manually.

  • Does someone know how to get the variable from the step "GetVariable" into the SQL Query?

    I have an variable org from from the source  [$Organization$] and want the variable org in my sql query.

    WHERE ko.ref = [=org=]

  • If you're using a pre-defined ticket variable you can just use WHERE ko.ref = [$Organization$] if you're creating your own variable you can use WHERE ko.ref=[=org=]

    Here's an example from one of my inserts where I'm using both types:

    sql="insert into dbo.xAgentProcTicketID values ('[=taskcode=]', '[$MachineGroup$]', '[$TicketId$]')"

    I use this to create a list of actions to be performed (denoted by taskcode) so when the action is complete the procedure can use TicketID to post it's results to the ticket. An example is after patches are installed on servers an email is sent to the service desk saying the server needs to reboot. A ticket is created , this SQL Statement is run and a sub procedure that reboots the server is scheduled to run at a specified time. When the server has rebooted it looks in that table for it's MachineGroup name, gets the TicketID and sends an email to the servicedesk saying it was complete. The servicedesk then closes the ticket. If the ticket is still open after 24hrs we know the reboot didn't work for whatever reason and we go find out why.



    Edited for typo.
    [edited by: JRiddle at 12:45 PM (GMT -7) on May 23, 2016]