ASCII() Function in SQL Server Last Updated : 07 Oct, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report The ASCII() function returns the ASCII value of the leftmost character of a character expression. Syntax : ASCII(character_expression) Parameter : This method accepts a single-parameter as mentioned above and described below : character_expression : It can be a literal character, an expression of a string, or a column. If more than one character is entered, it will only return the value for the leftmost character. Returns : It returns the ASCII code value of its leftmost character. Example-1 : When the arguments hold the single uppercase and lowercase letter. SELECT ASCII('A') AS A, ASCII('a') AS a, ASCII('Z') AS Z, ASCII('z') AS z; Output : A a Z z 65 97 90 122 Example-2 : When the arguments hold the single number and special character. SELECT ASCII('1') AS [1], ASCII('#') AS #, ASCII(9) AS [9], ASCII('@') AS [@]; Output : 1 # 9 @ 49 35 57 64 Example-3 : When the arguments hold the expression of a string. SELECT ASCII('GeeksForGeeks'); Output : 71 Example-4 : Using ASCII() function with table columns. Table - Player_Details PlayerId PlayerName City 45 Rohit Sharma Mumbai 18 Virat Kohli Bangalore 7 MS Dhoni Chennai 33 Hardik Pandya Mumbai 42 Sikhar Dhawan Delhi SELECT PlayerName, ASCII(PlayerName) AS AsciiCodeOfFirstChar FROM Player_Details; Output : PlayerName AsciiCodeOfFirstChar Rohit Sharma 82 Virat Kohli 86 MS Dhoni 77 Hardik Pandya 72 Sikhar Dhawan 83 Comment More infoAdvertise with us Next Article DAY() Function in SQL Server S sanjoy_62 Follow Improve Article Tags : SQL ASCII SQL-Server Similar Reads DAY() Function in SQL Server DAY() function : This function in SQL Server is used to return the day of the month i.e, from 1st to 31st for date stated. Features : This function is used to find the day of the month for a date specified. This function comes under Date Functions. This function accepts only one parameter i.e, date. 2 min read ATN2() Function in SQL Server In this article, we are going to cover the ATN2()function in which we will see how we can get the arc tangent of two given numbers. Let's discuss one by one. // here val1 and val2 are input. Input : ATN2(val1, val2) Output : Arc tangent result. ATN2() : It is the function that returns the arc tangen 1 min read COUNT() Function in SQL Server The COUNT() function in SQL Server is a fundamental aggregate function used to determine the number of rows that match a specific condition. Counting rows provides valuable insights into data sets such as the total number of records, distinct values, or records meeting certain criteria.In this artic 3 min read ASCII() Function in MySQL In this article, we are going to cover the ASCII function with examples and you will see the ASCII MYSQL query. And will also cover the ASCII code for the given character. Let's discuss one by one. ASCII function in MySQL is used to find the ASCII code of the leftmost character of a character expres 1 min read SQL Server LEN() Function SQL SERVER LEN() function calculates the number of characters of an input string, excluding the trailing spaces. LEN() Function in SQL ServerThe LEN function in the SQL Server fetches the number of characters in a string. It counts the preceding spaces but not the trailing spaces. For eg, 'SQL SERVE 2 min read IIF() Function in SQL Server IIF() function judges or evaluates the first parameter and returns the second parameter if the first parameter is true, otherwise, it returns the third parameter. IIF() function used in SQL Server to add if-else logic to queries.IIF is not supported in dedicated SQL pools in Azure Synapse Analytics. 2 min read Like