Tuesday, February 26, 2013

ASCII Function of SQL Server

In my previous posts, I explained Simple script to backup all SQL Server databases, Table-Valued Parameters and some other articles related to SQL Server. Here, I am going to explained ASCII function of SQL Server.

Ascii() Function

This function returns the ASCII code value of leftmost character of character expression.


Syntax- ASCII(character_expression)
Arguments- character_expression - An expression of type char or varchar
Return Type- int

Example-
Declare @value as varchar(50)
set @value='M'
select Ascii(@value)
--output 77
Declare @value as varchar(50)
set @value='Manish'
select Ascii(@value)
--output 77


No comments:

Post a Comment

If You Enjoyed This Post Please Take 5 Seconds To Share It.

^ Scroll to Top hgpromo