Beginner

323. CHAR Function

Learn how to convert a numeric character code into a character.

📘 Lesson 323 of 728 ⏱ 8 min 🎯 Intermediate

The CHAR function converts a numeric character code into a character in database systems that support this function.

Character conversion can be useful when generating text values, separators, or special characters dynamically.

Convert the numeric code 65 into the letter A.

SQL
SELECT
    CHAR(65) AS CharacterValue;

CHAR can be used in text formatting, report generation, data transformation, and SQL Server string processing.

  • CHAR converts a numeric code into text.
  • It can generate characters dynamically.
  • It is useful for text formatting.
  • SQL Server commonly supports CHAR.
  • Database-specific behavior can differ.
What does CHAR do?

CHAR converts a numeric character code into its corresponding character.

How is CHAR related to ASCII?

ASCII can return a numeric code from a character, while CHAR can convert a numeric code back into a character.

Have you finished this lesson?

Introduction to SQL – All Lessons