Skip to main content

ASCII

Returns the ASCII code value of the left-most character of the character expression. Syntax
Parameters
  • character_expression The character expression.
Examples

CHAR

Converts the integer ASCII code to the corresponding character. Syntax
Parameters
  • integer_expression The integer from 0 through 255.
Examples

CHARINDEX

Returns the starting position of the specified expression in the character string. Syntax
Parameters
  • expressionToFind The character expression to find.
  • expressionToSearch The character expression, typically a column, to search.
  • start_location The optional character position to start searching for expressionToFind in expressionToSearch.
Examples

CHAR_LENGTH

Returns the number of UTF-8 characters present in the expression. Syntax
Parameters
  • character_expression The set of characters to be evaluated for length.
Examples

CONCAT

Returns the string that is the concatenation of two or more string values. Syntax
Parameters
  • string_value1 The first string to be concatenated.
  • string_value2 The second string to be concatenated.
  • string_valueN The optional additional strings to be concatenated.
Examples

CONTAINS

Returns 1 if expressionToFind is found within expressionToSearch; otherwise, 0. Syntax
Parameters
  • expressionToSearch The character expression, typically a column, to search.
  • expressionToFind The character expression to find.
Examples

ENDSWITH

Returns 1 if character_expression ends with character_suffix; otherwise, 0. Syntax
Parameters
  • character_expression The character expression.
  • character_suffix The character suffix to search for.
Examples

FILESIZE

Returns the number of bytes present in the file at the specified file path. Syntax
Parameters
  • uri The path of the file to read the size from.
Examples

FORMAT

Returns the value formatted with the specified format. Syntax
Parameters
  • value The string to format.
  • parseFormat The string specifying the input syntax of the date value. Not applicable to numeric types.
  • format The string specifying the output syntax of the date or numeric format.
Examples

FROM_UNIXTIME

Returns a representation of the unix_timestamp argument as a value in YYYY-MM-DD HH:MM:SS expressed in the current time zone. Syntax
Parameters
  • time The time stamp value from epoch time. Milliseconds are accepted.
  • issecond Indicates the time stamp value is milliseconds to epoch time.
Examples

HASHBYTES

Returns the hash of the input value as a byte array using the given algorithm. The support algorithms are MD5, SHA1, SHA2_256, and SHA2_512. Syntax
Parameters
  • algorithm The algorithm to use for hashing. Must be one of MD5, SHA1, SHA2_256, or SHA2_512.
  • value The value to hash. Must be either a string or byte array.
Examples

INDEXOF

Returns the starting position of the specified expression in the character string. Syntax
Parameters
  • expressionToSearch The character expression, typically a column, to search.
  • expressionToFind The character expression to find.
  • start_location The optional character position to start searching for expressionToFind in expressionToSearch.
Examples

ISNULL

Replaces null with the specified replacement value. Syntax
Parameters
  • check_expression The expression to be checked for null.
  • replacement_value The expression to be returned if check_expression is null.
Examples

JSON_AVG

Computes the average value of a JSON array within a JSON object. The path to the array is specified in the jsonpath argument. Return value is numeric or null. Syntax
Parameters
  • json The JSON document to compute.
  • jsonpath The JSONPath used to select the nodes. [x], [2..], [..8], or [1..12] are accepted. [x] selects all nodes.
Examples

JSON_COUNT

Returns the number of elements in a JSON array within a JSON object. The path to the array is specified in the jsonpath argument. Return value is numeric or null. Syntax
Parameters
  • json The JSON document to compute.
  • jsonpath The JSONPath used to select the nodes. [x], [2..], [..8], or [1..12] are accepted. [x] selects all nodes.
Examples

JSON_EXTRACT

Selects any value in a JSON array or object. The path to the array is specified in the jsonpath argument. Return value is numeric or null. Syntax
Parameters
  • json The JSON document to extract.
  • jsonpath The XPath used to select the nodes. The JSONPath must be a string constant. The values of the nodes selected will be returned in a token-separated list.
Examples

JSON_MAX

Gets the maximum value in a JSON array within a JSON object. The path to the array is specified in the jsonpath argument. Return value is numeric or null. Syntax
Parameters
  • json The JSON document to compute.
  • jsonpath The JSONPath used to select the nodes. [x], [2..], [..8], or [1..12] are accepted. [x] selects all nodes.
Examples

JSON_MIN

Gets the minimum value in a JSON array within a JSON object. The path to the array is specified in the jsonpath argument. Return value is numeric or null. Syntax
Parameters
  • json The JSON document to compute.
  • jsonpath The JSONPath used to select the nodes. [x], [2..], [..8], or [1..12] are accepted. [x] selects all nodes.
Examples

JSON_SUM

Computes the summary value in JSON according to the JSONPath expression. Return value is numeric or null. Syntax
Parameters
  • json The JSON document to compute.
  • jsonpath The JSONPath used to select the nodes. [x], [2..], [..8], or [1..12] are accepted. [x] selects all nodes.
Examples

LEFT

Returns the specified number of characters counting from the left of the specified string. Syntax
Parameters
  • character_expression The character expression.
  • integer_expression The positive integer that specifies how many characters will be returned counting from the left of character_expression.
Examples

LEN

Returns the number of characters of the specified string expression. Syntax
Parameters
  • string_expression The string expression.
Examples

LOCATE

Returns an integer representing how many characters into the string the substring appears. Syntax
Parameters
  • substring The substring to find inside larger string.
  • string The larger string that will be searched for the substring.
Examples

LOWER

Returns the character expression with the uppercase character data converted to lowercase. Syntax
Parameters
  • character_expression The character expression.
Examples

LTRIM

Returns the character expression with leading blanks removed. Syntax
Parameters
  • character_expression The character expression.
Examples

MASK

Replaces the characters between start_index and end_index with the mask_character within the string. Syntax
Parameters
  • string_expression The string expression to be searched.
  • mask_character The character to mask with.
  • start_index The optional number of characters to leave unmasked at beginning of string. Defaults to 0.
  • end_index The optional number of characters to leave unmasked at end of string. Defaults to 0.
Examples

NCHAR

Returns the Unicode character with the specified integer code as defined by the Unicode standard. Syntax
Parameters
  • integer_expression The integer from 0 through 255.

OCTET_LENGTH

Returns the number of bytes present in the expression. Syntax
Parameters
  • character_expression The set of characters to be evaluated.
Examples

PATINDEX

Returns the starting position of the first occurrence of the pattern in the expression. Returns 0 if the pattern is not found. Syntax
Parameters
  • pattern The character expression that contains the sequence to be found. The wild-card character % can be used only at the start or end of the expression.
  • expression The expression, typically a column, to search for the pattern.
Examples

POSITION

Returns the starting position of the specified expression in the character string. Syntax
Parameters
  • expressionToFind The character expression to find.
  • expressionToSearch The character expression, typically a column, to search.
Examples

QUOTENAME

Returns a valid SQL Server-delimited identifier by adding the necessary delimiters to the specified Unicode string. Syntax
Parameters
  • character_string The string of Unicode character data. The string is limited to 128 characters. Inputs greater than 128 characters return null.
  • quote_character The optional single character to be used as the delimiter. Can be a single quotation mark, a left or right bracket, or a double quotation mark. If quote_character is not specified brackets are used.
Examples

REPLACE

Replaces all occurrences of a string with another string. Syntax
Parameters
  • string_expression The string expression to be searched. Can be a character or binary data type.
  • string_pattern The substring to be found. Cannot be an empty string.
  • string_replacement The replacement string.
Examples

REPLICATE

Repeats the string value the specified number of times. Syntax
Parameters
  • string_expression The string to replicate.
  • integer_expression The repeat count.
Examples

REVERSE

Returns the reverse order of the string expression. Syntax
Parameters
  • string_expression The string.
Examples
Returns the right part of the string with the specified number of characters. Syntax
Parameters
  • character_expression The character expression.
  • integer_expression The positive integer that specifies how many characters of the character expression will be returned.
Examples

RTRIM

Returns the character expression after it removes trailing blanks. Syntax
Parameters
  • character_expression The character expression.
Examples

SOUNDEX

Returns the four-character Soundex code, based on how the string sounds when spoken. Syntax
Parameters
  • character_expression The alphanumeric expression of character data.
Examples

SPACE

Returns the string that consists of repeated spaces. Syntax
Parameters
  • repeatcount The number of spaces.
Examples

SPLIT

Returns a section of the string between to delimiters. Syntax
Parameters
  • string The string to split.
  • delimiter The character to split the string with.
  • offset The number of the split to return. Positive numbers are treated as offsets from the left, and negative numbers are treated as offsets from the right.
Examples

STARTSWITH

Returns 1 if character_expression starts with character_prefix; otherwise, 0. Syntax
Parameters
  • character_expression The character expression.
  • character_prefix The character prefix to search for.
Examples

STR

Returns the character data converted from the numeric data. For example, STR(123.45, 6, 1) returns 123.5. Syntax
Parameters
  • float_expression The float expression.
  • length The optional total length to return. This includes decimal point, sign, digits, and spaces. The default is 10.
  • decimal The optional number of places to the right of the decimal point. The decimal must be less than or equal to 16.
Examples

STUFF

Inserts a string into another string. It deletes the specified length of characters in the first string at the start position and then inserts the second string into the first string at the start position. Syntax
Parameters
  • character_expression The string expression.
  • start The integer value that specifies the location to start deletion and insertion. If start or length is negative, null is returned. If start is longer than the string to be modified, character_expression, null is returned.
  • length The integer that specifies the number of characters to delete. If length is longer than character_expression, deletion occurs up to the last character in replaceWith_expression.
  • replaceWith_expression The expression of character data that will replace length characters of character_expression beginning at the start value.
Examples

SUBSTRING

Returns the part of the string with the specified length; starts at the specified index. Syntax
Parameters
  • string_value The character string.
  • start The positive integer that specifies the start index of characters to return.
  • length Optional. The positive integer that specifies how many characters will be returned.
Examples

TOSTRING

Converts the value of this instance to its equivalent string representation. Syntax
Parameters
  • string_value1 The string to be converted.
Examples

TRIM

Returns the character expression with leading and/or trailing blanks removed. Syntax
Parameters
  • trimspec Optional. If included must be one of the keywords BOTH, LEADING or TRAILING.
  • trimchar Optional. If included should be a one-character string value.
  • string_value The string value to trim.
Examples

UNICODE

Returns the integer value defined by the Unicode standard of the first character of the input expression. Syntax
Parameters
  • ncharacter_expression The Unicode character expression.

UPPER

Returns the character expression with lowercase character data converted to uppercase. Syntax
Parameters
  • character_expression The character expression.
Examples

XML_EXTRACT

Extracts an XML document using the specified XPath to flatten the XML. A comma is used to separate the outputs by default, but this can be changed by specifying the third parameter. Syntax
Parameters
  • xml The XML document to extract.
  • xpath The XPath used to select the nodes. The nodes selected will be returned in a token-separated list.
  • separator The optional token used to separate the items in the flattened response. If this is not specified, the separator will be a comma.
Examples