Skip to main content

Procedures

dbo.spAddNodeCustColumn

Add new custom property for object to NodeCust table.

Parameters

NameTypeDescription
@intKindIdintProperty kind ID (tblKind.intKindId)

dbo.spAssetTreeNodeChilds

Returns the object off-springs in the tree.

Parameters

NameTypeDescription
@nodeIdint

dbo.spAssetTreeNodeChilds_Rights

Returns the object off-springs in the tree, adheres to the permission in the object tree.

Parameters

NameTypeDescription
@nodeIdint
@personIdint

dbo.spAssignLicenceItemToChildren

Assigns the license item to historical upgrades as well.

Parameters

NameTypeDescription
@LicHistItemIdint

dbo.spCalcNodeName

Converts the tree object name according to the properties forming the object name.

Parameters

NameTypeDescription
@nodeIdint

dbo.spCalcNodeNameAll

Converts the names of all tree objects, the names of which are formed from properties.

Parameters

dbo.spCalcNodeNameClass

Converts the names of all tree objects, the names of which are formed from properties, according to the group ID.

Parameters

NameTypeDescription
@TemplateNodeIdint

dbo.spCalcNodeNameList

Parameters

NameTypeDescription
@NodeIdsnvarchar(max)

dbo.spCalcNodeNameSubtree

Converts the names of sub-tree objects, the names of which are formed from properties.

Parameters

NameTypeDescription
@parentIdint

dbo.spCalcUnreadTicket

Sets the flag of the ticket to read/unread by the person.

Parameters

NameTypeDescription
@PersonIdint
@HdTicketIdint
@ActIdint
@ApprovalItemIdint

dbo.spCloseHdTicket

Required values will be stored in tHdTicket after closing the ticket.

Parameters

NameTypeDescription
@iHdTicketIdint
@iSolverPersonIdint
@bIgnoreRightsbit

dbo.spConvertPropertiesToDate

Converts text properties of the specific kind to date type.

Parameters

NameTypeDescription
@intKindIdint
@newKindNamenvarchar(255)

dbo.spConvertPropertiesToFloat

Converts text properties of the specific kind to float type.

Parameters

NameTypeDescription
@intKindIdint
@newKindNamenvarchar(255)

dbo.spCopySection

Copies the @srcSectionId service and sets it as the child of the @dstParentSectionId service. The service can be copied including (@copyChildren) Subtree. The newly created service ID is available from the @newSectionId output parameter.

Parameters

NameTypeDescription
@srcSectionIdint
@dstParentSectionIdint
@copyChildrenbit
@newSectionIdint

dbo.spCreateDetects

Create scans according to parameters.

Parameters

NameTypeDescription
@nodesnvarchar(max)List of computer Ids separated with commas.
@kindIdintScan type ID (1=HW, 2=SW).
@isManualbit

Scan immediately.
Note: If the value is 1, the existing pending tickets are overwritten in order to accelerate them.

@methodIdintScan method ID. If it is NULL, the scan for this type is disabled.
@tcpIpPortintAgent TCP/IP port.
@isSwFullbitFull SW scan.
@swIncludenvarchar(255)SW scan, include files.
@swExcludenvarchar(255)SW scan, skip files.
@periodintScan period (days).
@personIdintPerson ID. If it is NULL, use the system account.

dbo.spCreateDetectsBySetting

Plans scans according to saved setting to a specific computer (or to all computers in the active registry).

Parameters

NameTypeDescription
@nodesnvarchar(max)List of computer Ids separated with commas. If the parameter is NULL, detections are planned according to the saved setting to all computers in the active registry.
@isManualbit

Scan immediately.
Note: If the value is 1, the existing pending tickets are overwritten in order to accelerate them.

@personIdintPerson ID. If it is NULL, use the system account.
@detectProfileIdint

Scan profile ID. If set, scans for selected computer nodes are scheduled according to this profile.
Note: If the value of @nodes is null, the parameter has no effect.

dbo.spCreateNodeFromTemplate

Creates an object based of the object template definition.

Parameters

NameTypeDescription
@templateClassint
@namenvarchar(255)
@targetint
@personint
@skipGenerateFromSequencebit
@computerSetIdint

dbo.spCustomColumn_Add

Add new custom field.

Parameters

NameTypeDescription
@sTablenvarchar(255)
@sColumnnvarchar(255)
@sTitlenvarchar(255)
@mDescriptionnvarchar(1024)
@nOrderfloat
@bUseColumnValuebit
@sTypenvarchar(255)
@nLengthint
@Multilinebit
@Localizebit
@RoleIdint

dbo.spCustomColumn_Drop

Removing custom fields.

Parameters

NameTypeDescription
@sTablenvarchar(255)
@sColumnnvarchar(255)

dbo.spDropNodeCustColumn

Drop custom property of object from tblKind and NodeCust table.

Parameters

NameTypeDescription
@intKindIdintProperty kind ID (tblKind.intKindId)

dbo.spEvalFileRule

Evaluation of one rule for files recognition.

Parameters

NameTypeDescription
@FileImageIdint

dbo.spEvalRegRule

Evaluation of the one rule for the recognition of registries.

Parameters

NameTypeDescription
@RegImageIdint

dbo.spEvalSwDetection

Evaluates SW scan based on patterns from the software products library.

Parameters

NameTypeDescription
@DetectIdint

dbo.spGeneratePropValuesFromSequence

Sets other values ​​for properties by numeric sequences.

Parameters

NameTypeDescription
@NodeIdint
@personint

dbo.spGetNextNumFromIdSeq

Increments numerical row definition and returns current definition. If uniqueness is breached, it automatically searches the next free number based on the row definition.

Parameters

NameTypeDescription
@IdSeqIdint
@actualNumnvarchar(255)

dbo.spHdSection_UpdateName

Full service name update (@iHdSectionId) including path in service tree.

Parameters

NameTypeDescription
@iHdSectionIdint

dbo.spHdSectionForRequesterSearch

Searching for the Requester’s services. Returns a table of services matching the entered parameters arranged by the path in the tree. The procedure can be customized. In order to customize the procedure, create a new procedure named spHdSectionForRequesterSearch_Custom and assign a permission to run it to the "db_executor" group. For the proper functionality of ALVAO applications, the procedure must receive the same parameters as the original procedure and return the same columns.

Parameters

NameTypeDescription
@samplenvarchar(300)
@countint
@personIdint
@requesterIdint
@isForMoveToServicebit

dbo.spHdTicketPassToSolver_ExceptionalSolverList

Returns a list of exceptional solvers, used to assign tickets listed in table #temp1. The procedure can be customized. In order to customize the procedure, create a new procedure named spHdTicketPassToSolver_ExceptionalSolverList_SolverList_Custom and assign a permission to run it to the "db_executor" group. For the proper functionality of ALVAO applications, the procedure must receive the same parameters as the original procedure and return the same columns. The @iUserPersonId parameter, representing the signed in user, is not used in the standard procedure.

Parameters

NameTypeDescription
@iUserPersonIdint

dbo.spHdTicketPassToSolver_SolverList

Returns a list of solvers, used to assign tickets listed in table #temp1. The procedure can be customized. In order to customize the procedure, create a new procedure named spHdTicketPassToSolver_SolverList_Custom and assign a permission to run it to the "db_executor" group. For the proper functionality of ALVAO applications, the procedure must receive the same parameters as the original procedure and return the same columns. The @iUserPersonId parameter, representing the signed in user, is not used in the standard procedure.

Parameters

NameTypeDescription
@iUserPersonIdint

dbo.spHdTicketPassToSolverInHdSection_ExceptionalSolverList

Returns a list of exceptional solvers, used to assign the ticket when transitioning to the @iHdSectionId service.

Parameters

NameTypeDescription
@iHdSectionIdint

dbo.spHdTicketPassToSolverInHdSection_SolverList

Returns a list of solvers, used to assign the ticket when transitioning to the @iHdSectionId service.

Parameters

NameTypeDescription
@iHdSectionIdint

dbo.spHdTicketRecalcFirstReaction

Recomputes the solution of the first reaction for the ticket.

Parameters

NameTypeDescription
@ticketIdint

dbo.spHdTicketRecalcNextActionDeadline

Recomputes the target date of the current target for the ticket.

Parameters

NameTypeDescription
@ticketIdint

dbo.spHdTicketResolve

Switches the ticket to Resolved.

Parameters

NameTypeDescription
@iHdTicketIdint
@iSolverPersonIdint
@bIgnoreRightsbit
@dResolveddatetime

dbo.spHdTicketSolverOpen

Reopens the ticket by the solver.

Parameters

NameTypeDescription
@iHdTicketIdint
@iSolverPersonIdint

dbo.spInsertToOperatorServiceUsage

A new record is inserted to the OperatorServiceUsage table or the LastUsed value is updated at the existing record.
Only 20 latest records are saved in the table for each user.

Parameters

NameTypeDescription
@PersonIdintID of the main solver who used the given service while registering the ticket.
@HdSectionIdintUsed service ID while registering the ticket.

dbo.spInsertToPersonEmailUsage

Inserts a new record into the PersonEmailUsage table.

Parameters

NameTypeDescription
@UsedByPersonIdintID of the user who used the e-mail address.
@UsedEmailvarcharUsed e-mail address for sending the message.

dbo.spMakeKindUnique

Update table tblKind and column txtName to be unique.

Parameters

dbo.spMoveNode

Moves the object in the object tree.

Parameters

NameTypeDescription
@nodeint
@targetint
@personint

dbo.spMoveNodes

Bulk transfer of objects.

Parameters

NameTypeDescription
@nodeIdsnvarchar(max)List of object IDs, separated by commas.
@destNodeIdintID of target object.
@personIdintID of the person who is performing the operation.
@dteHistdatetimeDate of transfer.
@retCodeint

Returned value in the form of a bit array:

  • 0 = operation was successful.
  • 1 = user is not authorized to transfer objects (role).
    Some objects were not transferred because:
  • 2 = the user is not authorized to carry out the transfer (object security).
  • 4 = the object has the attribute "immovable".
  • 8 = the transferred object is also the target object.
  • 16 = the target object is also a child object of one of the moved objects.
  • 32 = the transferred object is already a child object of the target object.
  • 64 = is moved to the Recycle Bin or Discarded assets and some objects have their own propertyIt is responsible for the assets together with a specific user

dbo.spNodeProperty

Returns the list of object properties with values converted to string.

Parameters

NameTypeDescription
@nodesNodeTable with object IDs (tblNode.intNodeId) for which all their properties are returned. If empty, properties for all objects are returned.
@kindIdintSpecific property kind (tblKind.intKindId).
@inheritedbitWhether to return inherited properties.
@localeIdint

dbo.spNotifyMacros

Auxiliary procedure which inserts the values of the macros used for configuring notifications into the #T table.

Parameters

NameTypeDescription
@iHdTicketIdint

dbo.spOpeningHoursCache_Update

Updates the tOpeningHoursCache table for specific operating hours.

Parameters

NameTypeDescription
@openingHoursIdintID of operating hours (tOpeningHours.iOpeningHoursId).

dbo.spPersonByPhoneNumber

Finds the user based on telephone number.

Parameters

NameTypeDescription
@callernvarchar(255)

dbo.spPersonSearch

The procedure returns the list of persons according to the searched chain. The procedure can be customized. In order to customize the procedure, create a new procedure named spPersonSearch_Custom2 and assign a permission to run it to the "db_executor" group. For a proper functionality of ALVAO applications, the procedure must receive the same parameters as the original ones (see below) and return the same columns. The procedure returns the table containing the following columns:
PersonId - contains Id of the User found. We do not recommend customizing.
PersonEmail - contains the primary e-mail of the User found. We do not recommend customizing.
PersonEmail2 - it contains the secondary e-mail of the User found by default. We do not recommend customizing.
DisplayLine1 - it contains the User name and surname by default. The value of this column is used in prompting the persons on the first line of the item on the WebApp. The column can be customized.
DisplayLine2 - contains the department, office, personal number, organization, office phone and cell phone of the person. The value of this column is used in prompting the persons on the second line of item on the WebApp. The column can be customized.
DisplaySingleLine - it contains DisplayLine1 and DisplayLine2 combined columns by default. The column can be customized.

Parameters

NameTypeDescription
@samplenvarchar(100)Searched string. If the procedure is not customized, the search proceeds in the person's name, department, office, personal number, organization, office phone number and cell phone number.
@accountIdintId of the organization in which the persons are to be searched. If the value is NULL the search will take place among all persons.
@guestbitIt specifies whether the Host type user will also be shown in the results.
@personIdintPerson Id. If it is filled and the @sample parameter is NULL, the procedure returns a person with the given Id.
@wherenvarchar(4000)Text string in which it is possible to define the custom part of the where condition for an assembled query. For proper functionality of ALVAO applications it is necessary that the custom procedure contains a tPerson table with a p alias.
@topintSpecifies the number of selected records. If the @top is not filled in, the procedure returns 100 records.
@onlyCustomizableUsersbit
@rightLimitationPersonIdint

dbo.spReadAllCommunication

Marks all communication within the ticket regarding the entered person as read.

Parameters

NameTypeDescription
@PersonIdint
@TicketIdint

dbo.spReadAllDiary

Marks all ticket events with regard to the entered person as read.

Parameters

NameTypeDescription
@PersonIdint
@TicketIdint

dbo.spRebuildHdSectionLocalizationCache

Restores the localization cache for services.

Parameters

dbo.spRebuildLocalizationCache

Restores all the localization cache.

Parameters

dbo.spRebuildReorganizeIndexes

Rebuild or reorganize all indexes in the database based on their current fragmentation.

Parameters

dbo.spRecalcCustColInformation

Recalculates information about the type and length of records in the tColumn table.

Parameters

dbo.spRefreshLicProductCoverage

Updates the ProductCoverage table (the whole one or only a specific license)

Parameters

NameTypeDescription
@LicHistIdint

dbo.spRefreshNodeParent

Recalculates the parent-child object cache in the tblNodeParent table.

Parameters

NameTypeDescription
@parentIdintThe ID of the object in whose sub-tree the cache is to be recalculated. NULL = whole tree.

dbo.spRefreshNodePath

Updates the cache of the path in the tree (tblNode.txtPath).

Parameters

NameTypeDescription
@nodeint

dbo.spRefreshRolePersonMembership

Updates the cache of the persons' membership in groups.

Parameters

dbo.spRefreshSwProfileProductMembership

Updates the cache of the software sub-profiles membership in profiles.

Parameters

dbo.spRemoveDetectResults

Removes the results of specific scans (ID,ID,...).

Parameters

NameTypeDescription
@detlistnvarchar(max)

dbo.spRemoveDetects

Removes the specific scan (ID,ID,...).

Parameters

NameTypeDescription
@detlistnvarchar(max)

dbo.spRemoveNodes

Permanently removes specific objects from tree (ID,ID,...).

Parameters

NameTypeDescription
@nodesnvarchar(max)

dbo.spRemoveObjects

Permanently deletes specific objects from the tree, including child objects (ID, ID ...).

Parameters

NameTypeDescription
@nodesnvarchar(max)
@childonlybit
@maxremoveint

dbo.spReplaceSectionRights

Overwrites the permissions of the @dstSectionId service by permissions according to @srcSectionId service.

Parameters

NameTypeDescription
@srcSectionIdint
@dstSectionIdint

dbo.spReplaceSectionSLA

Overwrites the SLA setting of the @dstSectionId service by SLA setting according to @srcSectionId service.

Parameters

NameTypeDescription
@srcSectionIdint
@dstSectionIdint

dbo.spRequestCommunication

Ticket events in the Communication, Important or Detailed log mode.

Parameters

NameTypeDescription
@iHdTicketIdintTicket ID (tHdTicket.iHdTicketId).
@showRemovedbitDisplay deleted records. 0 = no, 1 = yes.
@iPersonIdintLogged in person ID (tPerson.iPersonId).
@startintThe order of the event from which the result will be returned (sorted chronologically).
@specificActIdintSpecific event ID (Tact.iActId). If entered, the content of only this one event is returned.
@modeintMode. 1 = Communication, 2 = Important, 3 = Detailed log.
@localeIdintLCID of the language in which the dynamically generated events will be generated. E.g. for CZ = 1029, EN = 1033.
@ftsConditionsnvarchar(max)
@querynvarchar(max)
@topintLimits number of returned events.
@includeTotalbit1 = Total column contains number of all events, 0 = Total column is NULL

dbo.spRequiredPropertyValuesCheck

Converts the warning cache to blank mandatory properties in the tblNode table.

Parameters

NameTypeDescription
@nodeIdsnvarchar(max)The ID of the object in which the cache is to be recalculated.
@recalculateAllbitFlag whether to recalculate the cache for all objects in the tblNode table.

dbo.spRequiredPropertyValuesCheck_TemplateProp

Parameters

NameTypeDescription
@kindIdint

dbo.spSavePersonTicketDisplay

Inserts a record in the history of the last viewed tickets of the requester.

Parameters

NameTypeDescription
@ticketIdint
@personIdint

dbo.spSetContextInfo

Will set the user’s ID and date of action within the context of the database connection. These data are used, e.g., in the triggers which create the audit trace.

Parameters

NameTypeDescription
@personIdintUser ID (tPerson.iPersonId)
@datedatetimeDate & time. If not entered, the current date and time will be used.

dbo.spStateReqCol

Returns a table with required items for transitioning the ticket @TicketId to @NewStateId.

Parameters

NameTypeDescription
@TicketIdint
@NewStateIdint
@LocaleIdint

dbo.spTakeLicence

Withdraws license for the computer software.

Parameters

NameTypeDescription
@LicHistItemIdint

dbo.spTicketSearch

Returns a list of tickets by the specified string.

Parameters

NameTypeDescription
@samplenvarchar(100)
@personIdint
@countint
@wherenvarchar(4000)

dbo.spTransferLicence

Transfers the license on a different computer / to a different cost center.

Parameters

NameTypeDescription
@itemIdint
@personint
@NewComputerNodeIdint
@NewCostCentrenvarchar(255)

dbo.spUpdateColumnValuePath

Updates values in hierarchic list of values (tColumnValue) for the @ColumnId custom field.

Parameters

NameTypeDescription
@ColumnIdint

dbo.spUpdateFTS

Update data in the FullTextSearch column for a specific @iHdTicketId ticket or for all tickets when entering 0 to the parameter.

Parameters

NameTypeDescription
@iHdTicketIdint

dbo.spUpdateHdSectionRightsCache

Updates the authorization cache on services.

Parameters

dbo.spUpdateInsertProperty

Updates the value of ALVAO system settings. If the setting does not exist, it is created.

Parameters

NameTypeDescription
@PropertyNamenvarchar(255)
@sPropertyValuenvarchar(2048)
@bPropertyValuebit
@iPropertyValueint
@dPropertyValuedatetime

dbo.spUpdateNodeCachedCols

Updates values in cached object columns.

Parameters

NameTypeDescription
@nodeIdsnvarchar(max)List of object IDs (tblNode.intNodeId), separated by commas. When NULL, procedure updates columns on all objects.

dbo.spUpdateNodeCust_All

Updates property inheritance for the whole database.

Parameters

dbo.spUpdateNodeCust_Nodes

Updates property inheritance for a specific nodes and subtrees.

Parameters

NameTypeDescription
@nodeIdsnvarchar(max)

dbo.spUpdateNodeCust_ObjNew

Updates property inheritance after a new object was created.

Parameters

NameTypeDescription
@objIdint

dbo.spUpdateNodeCust_PropNew

Updates property inheritance after a new object property was added.

Parameters

NameTypeDescription
@kindIdint

dbo.spUpdateNodeCust_PropValChanged

Updates property inheritance after a change in the property value.

Parameters

NameTypeDescription
@objIdint
@kindIdint

dbo.spUpdateNodeCust_Subtree

Updates the property inheritance for a specific subtree.

Parameters

NameTypeDescription
@objIdint

dbo.spUpdateNodeCust_TemplateProp

Parameters

NameTypeDescription
@kindIdint

dbo.spUpdateNodeSearch

Update data in the Search column for a specific object or for all objects when entering invalid NodeId.

Parameters

NameTypeDescription
@NodeIdintObject ID (tblNode.intNodeId) to update.
@ClassIdintObject type ID (tblClass.intClassId) to update. Only objects of that type are updated.

dbo.spUpdatePersonManager

The procedure for the update of the pre-counted structure of managers and employees.

Parameters

dbo.spUpdatePropertyValue

Changes the value of the object property in AM. If history is permitted for the object, the change will be recorded in the log. If the property is the name of the object, it will be converted according to the new value.

Parameters

NameTypeDescription
@nodeIdint
@kindIdint
@valueStringnvarchar(255)
@valueDatedate
@valueFloatfloat
@valueIntint
@personIdint
@shouldLogbit

dbo.spUpdateSlaPausedHours

Recalculates the time period of the SLA ticket pause.

Parameters

NameTypeDescription
@ticketIdint

dbo.spUpdateStatistics

Updating statistics of all tables in the database.

Parameters

dbo.spUpdateTicketAlert

Updates the record in tHdTicket based on the current TicketAlert content.

Parameters

NameTypeDescription
@iHdTicketIdintTicket ID.

dbo.spUpdateTicketHoursToCurrentTarget

Recomputes the time elapsed from the previous operating hours interval to the due date of the current target, either for all tickets with an internal target (when 1 is in @forceALL), for a specific ticket (when @ticketID is entered), or for all tickets which were transferred to the next interval of the operating hours (when NULL is entered in both parameters).

Parameters

NameTypeDescription
@forceAllbitDecide whether the recalculation should be done for all tickets with an internal goal.
@ticketIdintTicket number for which a recalculation will be forced.

dbo.spUpdateTicketLastAction

Coverts the date of the last action related to the entered ticket number.

Parameters

NameTypeDescription
@TicketIdint

dbo.spWebAppLoginDelay

Protection against password-guessing attack.

Parameters

NameTypeDescription
@loginTryint