O'Reilly logo

Microsoft SQL Server 2012 T-SQL by Debra Aaron, Tom Coffing

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 11 – Working with Strings

“It’s always been and always will be the same in the world: the horse does the work and the coachman is tipped.”

- Anonymous

The ASCII Function

The example below shows you how to convertcharacters into the integer ASCII value.

Syntax: ASCII (string)

SELECT

ASCII('H') as AsciiH

,ASCII('o') as AsciiO

,ASCII('w') as AsciiW

,ASCII('d') as AsciiD

,ASCII('y') as AsciiY

image

The example above shows you how to convert characters into the integer ASCII value.

The CHAR Function

The example below shows you how to convertthe integer ASCII value into characters.

Syntax: CHAR (integer)

SELECT

CHAR(72) As CharH

,CHAR(111) ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required