ASCII String Function In SQL Server 2008

In this article i will explain how to use the ASCII string function.
  • 3448

Introduction

ASCII (str) string function is used to return numeric value (ASCII code value) of left-most character of the given string str. It takes 1 argument as string/character expression.

  • It will return 0 if str is empty.
  • It will return NULL if str is NULL.

Syntax

ASCII (character_expression)

Example

Return ASCII value of a character.

Character-ASCII-value-in-sql.jpg

To return the ASCII value  for each character in the string "ASCII Function Example".

ASCIIStringFuction-in-sql.jpg

Categories

More Articles

© 2019 DotNetHeaven. All rights reserved.