What is the difference between ASCII() and CHAR() functions?

ASCII() vs CHAR(): ASCII() and CHAR() functions work with ASCII characters. But the functionality wise, both work quiet opposite. ASCII() function returns the ASCII code number for the given character as input. Where as, CHAR() function returns the ASCII character for the

Read More

What is the difference between the basic datatypes Char and Varchar?

Char 1. It is fixed memory allocation. Ex: —————————————————- DECLARE @CharTest CHAR(10) SET @CharTest = ‘ABCD’ SELECT DATALENGTH(@CharTest) —————————————————- Output: 10 —————————————————- 2. Takes more memory space compare to Varchar. 3. Query performance is better. 4. It fills the unused memory space with

Read More