You are on page 1of 7

1.

ASCII

Returns the ASCII code value of the leftmost character of a character expression.

Syntax: ASCII ( character_expression )

Arguments : character_expression Is an expression of the type char or varchar.

2. CHAR
A string function that converts an int ASCII code to a character.
Syntax: CHAR ( integer_expression )

Arguments :integer_expression. Is an integer from 0 through 255. NULL is returned if


the integer expression is not in this range.

3. CHARINDEX
Returns the starting position of the specified expression in a character string.

Syntax:CHARINDEX ( expression1 , expression2 [ , start_location ] )

Arguments

expression1

Is an expression containing the sequence of characters to be found. expression1 is an expression


of the short character data type category.

expression2

Is an expression, usually a column searched for the specified sequence. expression2 is of the
character string data type category.

start_location

Is the character position to start searching for expression1 in expression2. If start_location is not
given, is a negative number, or is zero, the search starts at the beginning of expression2.
4.DIFFERENCE

Returns the difference between the SOUNDEX values of two character expressions
as an integer.

Syntax: DIFFERENCE ( character_expression , character_expression )

Arguments: character_expression. Is an expression of type char or varchar.

5. LEFT

Returns the part of a character string starting at a specified number of characters


from the left.

Syntax: LEFT ( character_expression , integer_expression )

Arguments:

character_expression

Is an expression of character or binary data. character_expression can be a constant, variable, or


column. character_expression must be of a data type that can be implicitly convertible to
varchar. Otherwise, use the CAST function to explicitly convert character_expression.

integer_expression

Is a positive whole number. If integer_expression is negative, a null string is returned.

6. LEN

Returns the number of characters, rather than the number of bytes, of the given string expression,
excluding trailing blanks.

Syntax: LEN ( string_expression )

Arguments: string_expression. Is the string expression to be evaluated.


7.LOWER

Returns a character expression after converting uppercase character data to lowercase.

Syntax: LOWER ( character_expression )

Arguments: character_expression

Is an expression of character or binary data. character_expression can be a constant, variable, or


column. character_expression must be of a data type that is implicitly convertible to varchar.
Otherwise, use CAST to explicitly convert character_expression

8. LTRIM

Returns a character expression after removing leading blanks.

Syntax: LTRIM ( character_expression )

Arguments: character_expression

Is an expression of character or binary data. character_expression can be a constant, variable, or


column. character_expression must be of a data type that is implicitly convertible to varchar.
Otherwise, use CAST to explicitly convert character_expression.

9. REPLACE

Replaces all occurrences of the second given string expression in the first string expression with
a third expression.

Syntax: REPLACE ( 'string_expression1' , 'string_expression2' , 'string_expression3' )

Arguments

'string_expression1': Is the string expression to be searched. string_expression1 can be of


character or binary data.

'string_expression2': Is the string expression to try to find. string_expression2 can be of


character or binary data.

'string_expression3' : Is the replacement string expression string_expression3 can be of character


or binary data.
10.REVERSE

Returns the reverse of a character expression.

Syntax: REVERSE ( character_expression )

Arguments

character_expression: Is an expression of character data. character_expression can be a


constant, variable, or column of either character or binary data.

11. RIGHT

Returns the part of a character string starting a specified number of integer_expression characters
from the right.

Syntax: RIGHT ( character_expression , integer_expression )

Arguments

character_expression

Is an expression of character data. character_expression can be a constant, variable, or column of


either character or binary data.

integer_expression

Is the starting position, expressed as a positive whole number. If integer_expression is negative,


an error is returned.

12. RTRIM

Returns a character string after truncating all trailing blanks.

Syntax

RTRIM ( character_expression )

Arguments

character_expression

Is an expression of character data. character_expression can be a constant, variable, or column of


either character or binary data.
13. SPACE

Returns a string of repeated spaces.

Syntax

SPACE ( integer_expression )

Arguments

integer_expression

Is a positive integer that indicates the number of spaces. If integer_expression is negative, a null
string is returned.

14. STUFF

Deletes a specified length of characters and inserts another set of characters at a specified
starting point.

Syntax

STUFF ( character_expression , start , length , character_expression )

Arguments

character_expression

Is an expression of character data. character_expression can be a constant, variable, or column of


either character or binary data.

start

Is an integer value that specifies the location to begin deletion and insertion. If start or length is
negative, a null string is returned. If start is longer than the first character_expression, a null
string is returned.

length

Is an integer that specifies the number of characters to delete. If length is longer than the first
character_expression, deletion occurs up to the last character in the last character_expression.
15. SUBSTRING

Returns part of a character, binary, text, or image expression.

Syntax: SUBSTRING ( expression , start , length )

Arguments

expression

Is a character string, binary string, text, image, a column, or an expression that includes a
column. Do not use expressions that include aggregate functions.

start

Is an integer that specifies where the substring begins.

length

Is an integer that specifies the length of the substring (the number of characters or bytes to
return)

16. UPPER

Returns a character expression with lowercase character data converted to uppercase.

Syntax

UPPER ( character_expression )

Arguments

character_expression

Is an expression of character data. character_expression can be a constant, variable, or column of


either character or binary data.
17. UNICODE

Returns the integer value, as defined by the Unicode standard, for the first character of the input
expression.

Syntax

UNICODE ( 'ncharacter_expression' )

Arguments

'ncharacter_expression'

Is an nchar or nvarchar expression.

You might also like