CHAR function in SQL Server
The article will explore and show you how to use the CHAR function in SQL Server to convert ASCII code values into characters.
Describe
CHAR function in SQL Server is used to convert an integer expression into the corresponding character in ASCII code.
The CHAR function is used against the ASCII Quantrimang function introduced in the previous article.
Syntax
To run CHAR function in SQL Server, we use the following syntax:
CHAR(bieu
compare it)
Parameters :
- How to compare : an integer value from 0 to 255 . If the integer expression is a value outside of this range , CHAR () will return NULL .
CHAR function can only be used in later versions of SQL Server: SQL Server 2017, SQL Server 2016, SQL Server 2014, SQL Server 2012, SQL Server 2008 R2, SQL Server 2008, SQL Server 2005.
For example
Take a look and explore some examples of CHAR functions in SQL Server.
SELECT CHAR('113');
Result: q
SELECT ASCII('81');
Result: Q
See also: ASCII encoding and Latin character table ISO 1252
Last lesson: ASCII function in SQL Server
Next lesson: CHARINDEX function in SQL Server
You should read it
- Putchar () function in C
- The strrchr () function in C
- The strchr () function in C
- The strtok () function in C
- Function fputc () in C
- The function ungetc () in C
- Strcpy () function in C
- Function putc () in C
- Strncat () function in C
- The strncpy () function in C
- The function strpbrk () in C
- The strstr () function in C