SqlShare.com Logo
 
Skip Navigation Links
Home
Video List
Events
Classes
About Us
Login / Register
Subscribe RSS Feed 

Confio Ignite 8

Using ASCII, CHAR, UNICODE, and NCHAR

ASCII and CHAR allow you to convert a character to a number and a number to a character respectively. UNICODE and NCHAR are the unicode (nchar/nvarchar) equivalents. Probably among the lesser used of the string functions, but easy to master and you will find a use for them here and there - one example we demonstrate is using CHAR to embed a 'non-printable' character in a string.

Duration:
5 mins 12 secs
Skill Level:
100
Rating:
4.34 out of 5
Publish Date:
October 27, 2010
Using ASCII, CHAR, UNICODE, and NCHAR You must be logged in to view this video.  
Bookmark and Share
 
1=Poor, 3=Good, 5=Excellent

About the Author

Image of Andy Warren
Andy Warren is a software trainer focusing on SQL Server, a member of the PASS Board of Directors, and a principal in this site - SQLShare.com.

References



Comments
Bridget on 10/27/2010
would be cool if the results window could be bigger...after a statement is executed

C G on 10/27/2010
Nothing too interesting.

Jamshid Nouri on 10/27/2010
excellent demo, Thanks!!!

Dexter Jones on 10/27/2010
Thanks, Andy.

Yelena Varshal on 10/27/2010
I wonder why data from multiple lines from the same MS Excel cell or same MS ACCESS record imported into SQL Server using SSIS contain only char(10) between 2 lines. The output appears on 1 line in Management Studio query with the results in grid and on multiple lines with the results as text. I too used to Char(13) + Char(10) but Char(13) was not found in these cases. Good presentation Yelena Varshal yelena.varshal@philips.com

Martin Miller on 10/27/2010
Here is a simple to script to through the alphabet using ASCII function: DECLARE @alpha TINYINT SET @alpha = ASCII('A') WHILE @alpha <= ASCII('Z') BEGIN PRINT CHAR(@alpha) SET @alpha = @alpha + 1 END

bam on 10/27/2010
never new this

kalapala baburao on 10/27/2010
good

Tomislav on 10/28/2010
very nice. simple and clear!

Alexander on 10/28/2010
very nice video

Adding or subtracting 32 to go from upper to lower is 'magic' because it is really just a bit flipping in the byte representing the character. Right?

ranu on 10/30/2010
gud .as always

Diana Dee on 11/1/2010
Thank you for making the result pane have larger print!!

A43036427E on 11/9/2010
This was good but I would slowed it down by a few percent.

Kat on 11/26/2010
Great info on how to get the ASCII representation - this will be very useful.



Must Be Logged In
 

How Do I Become a Video Author? |  Newsletter History

Copyright © Fourdeuce, Inc., 2005-2009. All Rights Reserved | Privacy Policy | Terms & Conditions