Skip to main content

Scalar functions

dbo.DefaultSlaId​

Returns the default SLA for on-duty requesters.

Parameters​

NameTypeDescription

@iHdSectionId

int

@iPersonId

int

dbo.fAddressString​

Formats the address properties from tAddress to one string.

Parameters​

NameTypeDescription

@addressId

int

dbo.fDate​

Returns date without time only.

Parameters​

NameTypeDescription

@datetime

datetime

dbo.fDateHoursMinutes​

Cut-off of seconds from date and time records.

Parameters​

NameTypeDescription

@d

datetime

dbo.fDeadline​

Calculates deadline in the service operating hours.

Parameters​

NameTypeDescription

@liOpeningHours

int

@dFrom

datetime

@nHours

float

dbo.fHtmlString​

Encodes a string as valid HTML, including ends of lines.

Parameters​

NameTypeDescription

@s

nvarchar(4000)

dbo.fIsAfterDeadline​

Checks whether the actual moment is after the deadline in the service operating hours.

Parameters​

NameTypeDescription

@liOpeningHours

int

@dFrom

datetime

@nHours

float

dbo.fLastLevelDomain​

Returns the last level of the domain.

Parameters​

NameTypeDescription

@LoginWithDomain

nvarchar(255)

dbo.fnCheckRelCycles​

Checks the circular task link between tickets.

Parameters​

NameTypeDescription

@trId

int

@ticketBegin

int

@ticketEnd

int

@relTypeId

int

dbo.fnCheckRelCyclesLicHist​

Function for reviewing a circular task.

Parameters​

NameTypeDescription

@nrId

int

@beginLicHistId

int

@endLicHistId

int

@relTypeId

int

dbo.fnCheckRelCyclesNode​

Function for reviewing a circular task.

Parameters​

NameTypeDescription

@nrId

int

@beginNodeId

int

@endNodeId

int

@relTypeId

int

dbo.fnCheckRelDuplicity​

Checks the link between tickets for duplicity.

Parameters​

NameTypeDescription

@trId

int

@ticketBegin

int

@ticketEnd

int

@relTypeId

int

dbo.fnCheckRelOneToMany​

Checks whether the ticket has maximum one link of the 1:N type.

Parameters​

NameTypeDescription

@trId

int

@ticketBegin

int

@ticketEnd

int

@relTypeId

int

dbo.fnCreateColumnName​

Transforms the string to usable string for database column name.

Parameters​

NameTypeDescription

@str

nvarchar(255)

Any string to the transgform.

dbo.fnCutSymbolsFromQuery​

Returns a string without unnecessary symbols.

Parameters​

NameTypeDescription

@sample

nvarchar(max)

dbo.fnFileStringInfoCsvSignature​

CSV file signature from FileStringInfo part.

Parameters​

NameTypeDescription

@id

int

dbo.fnFindAssetUserFromPerson​

According to PersonId of the user in Administration, NodeId finds the user in the objects tree in AM.

Parameters​

NameTypeDescription

@personId

int

dbo.fnFloatHourToTimeString​

Converts the value of hours from a floating point number into a text string in the h:mm format.

Parameters​

NameTypeDescription

@hours

float

dbo.fnFloatToCharExactLength​

The function returns a number (float) as a string with the set minimum length of the integer part and the maximum length of the fractional part, which is guaranteed by completing with zeroes, or rounding where applicable. The maximum length is 50, which is an appropriately selected constant.

Parameters​

NameTypeDescription

@value

float

@intLen

int

@decLen

int

dbo.fnGetBackupKindName​

Suffix of properties with original data in which the conversion to another data type failed.

Parameters​

NameTypeDescription

@intKindId

int

dbo.fnGetDateDiffInOpeningHours​

Custom difference in hours between two dates in given operating hours.

Parameters​

NameTypeDescription

@from

datetime

Date from (UTC)

@to

datetime

Date until (UTC)

@openingHoursId

int

Identifier for operating hours

dbo.fnGetNextSectionId​

Parameters​

dbo.fnGetNextTicketId​

Function returns id of newly created ticket.

Parameters​

dbo.fnGetSlaByImpactUrgency​

Finds best SLA for a given requester and service based on impact and urgency items.

Parameters​

NameTypeDescription

@impactColumnValueId

int

Impact ID, value iColumnValueId from table tColumnValue.

@urgencyColumnValueId

int

Urgency ID, value iColumnValue from table tColumnValue

@hdSectionId

int

Service ID

@requesterPersonId

int

Requester ID

dbo.fnGetUnreadCount​

Number of unread events of the person on ticket.

Parameters​

NameTypeDescription

@PersonId

int

@TicketId

int

dbo.fnHdSectionWithoutLast​

The function returns the full service name (path) excluding the name of the service

Parameters​

NameTypeDescription

@SectionId

int

dbo.fnLastLocalMidnightUtc​

The calculation of the last local midnight according to UTC time and the time zone.

Parameters​

NameTypeDescription

@utc

datetime

@tzuid

nvarchar(128)

dbo.fnLocalTime​

Converts UTC data to the specific time zone.

Parameters​

NameTypeDescription

@utc

datetime

@tzuid

nvarchar(128)

dbo.fnLocalTimeString​

Converts UTC data to the specific time zone and returns as a string formated in specified language.

Parameters​

NameTypeDescription

@utc

datetime

@tzuid

nvarchar(128)

@localeId

int

dbo.fnNextLocalMidnightUtc​

The calculation of the following local midnight according to UTC time and the time zone.

Parameters​

NameTypeDescription

@utc

datetime

@tzuid

nvarchar(128)

dbo.fnPersonLoginWithoutDomain​

Username of a person without a domain.

Parameters​

NameTypeDescription

@sPersonLogin

nvarchar(255)

dbo.fnReportedTime​

The calculation of time reported on the selected day and for the selected employee.

Parameters​

NameTypeDescription

@utc

datetime

@tzuid

nvarchar(128)

@personId

int

dbo.fnStartWorkTime​

The calculation of the time at which the selected employee began working on the selected day.

Parameters​

NameTypeDescription

@utc

datetime

@tzuid

nvarchar(128)

@personId

int

dbo.fnTimeZoneOffset​

Returns the deviation in hours and minutes of the time zone from UTC at a given time.

Parameters​

NameTypeDescription

@utc

datetime

Time in UTC.

@tzuid

nvarchar(128)

Time zone identifier, see dbo.TimeZone.uid.

dbo.fnTodayHour​

Converts a floating point number into the item type date and time where date is today's date and time is transferred from the parameter.

Parameters​

NameTypeDescription

@hour

float

dbo.fnUtcTime​

UTC time calculated from the local time and time zones.

Parameters​

NameTypeDescription

@local

datetime

@tzuid

nvarchar(128)

dbo.fnWorkTimeAtDay​

The calculation of the worked on the selected day for the selected employee.

Parameters​

NameTypeDescription

@utc

datetime

@tzuid

nvarchar(128)

@personId

int

dbo.fnWorkTimeToday​

The calculation of the time at which the selected employee began working on the selected day. The calculation does not consider the end of the day, only up to "now"

Parameters​

NameTypeDescription

@utc

datetime

@tzuid

nvarchar(128)

@personId

int

dbo.fRelatedCompany​

Ticket - "Related Organizations" item

Parameters​

NameTypeDescription

@iHdTicketId

int

dbo.fStripDomain​

Username of a user without a domain.

Parameters​

NameTypeDescription

@LoginWithDomain

nvarchar(255)

dbo.fSuggestResolutionDate​

Default due date by SLA.

Parameters​

NameTypeDescription

@Ticketid

int

dbo.GetProperty​

Returns 1 value from the tProperty table based on the set code.

Parameters​

NameTypeDescription

@key

nvarchar(255)