CHAR function in SQL Server
CHAR function in SQL Server is used to convert an integer expression into the corresponding character in ASCII code.
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
Discover more
mssqlShare by
Samuel DanielYou should read it
- The strchr () function in C
- The strtok () function in C
- Function fputc () in C
- The function ungetc () in C
- Strcpy () function in C
- The Quiet Details That Make a Sports Betting Platform Feel Reliable
- Instructions on creating toy set images with ChatGPT AI
- How are AI agents changing the journalism industry?
- CHARINDEX function in SQL Server
- CONCAT function in SQL Server
- The '+' operator in SQL Server