User Tools

Site Tools


microsoft:microsoft_sql_server:sql:char_function

Microsoft - Microsoft SQL Server - SQL - CHAR function

The SQL Server CHAR String Function converts any of 256 the integer ASCII codes to a character value.


Control Characters

ASCII codes 0 through 31 are non-printable, or control characters.

Integer ValueCharacterInteger ValueCharacterInteger ValueCharacter
0null12form feed24cancel
1start of header13carriage return25end of medium
2start of text14shift out26substitute
3end of text15shift in27escape
4end of transmission16data link escape28file separator
5enquiry17device control 129group separator
6acknowledge18device control 230record separator
7bell19device control 331unit separator
8backspace20device control 4
9horizontal tab21negative acknowledge
10line feed22synchronize
11vertical tab23end of trans. block

Commonly used control characters along with the output of them used in PRINT statements.

PRINT 'a' + CHAR(9)  + 'b' -- horizontal tab 
PRINT 'a' + CHAR(10) + 'b' -- line feed 
PRINT 'a' + CHAR(11) + 'b' -- vertical tab 
PRINT 'a' + CHAR(13) + 'b' -- carriage return
SQL Server T-SQL CodeResult
PRINT 'a' + CHAR(9) + 'b'a b
PRINT 'a' + CHAR(10) + 'b'a
b
PRINT 'a' + CHAR(11) + 'b'a b
PRINT 'a' + CHAR(13) + 'b'a
b

Printable Characters

ASCII codes 32 through 127 are regular, printable characters.

Int ValueCharacterInt ValueCharacter
32Space80Uppercase P
33Exclamation mark81Uppercase Q
34Double quotes (or speech marks)82Uppercase R
35Number83Uppercase S
36Dollar84Uppercase T
37Per cent sign85Uppercase U
38Ampersand86Uppercase V
39Single quote87Uppercase W
40Open parenthesis (or open bracket)88Uppercase X
41Close parenthesis (or close bracket)89Uppercase Y
42Asterisk90Uppercase Z
43Plus91Opening bracket
44Comma92Backslash
45Hyphen93Closing bracket
46Period, dot or full stop94Caret - circumflex
47Slash or divide95Underscore
48Zero96Grave accent
49One97Lowercase a
50Two98Lowercase b
51Three99Lowercase c
52Four100Lowercase d
53Five101Lowercase e
54Six102Lowercase f
55Seven103Lowercase g
56Eight104Lowercase h
57Nine105Lowercase i
58Colon106Lowercase j
59Semicolon107Lowercase k
60Less than (or open angled bracket)108Lowercase l
61Equals109Lowercase m
62Greater than (or close angled bracket)110Lowercase n
63Question mark111Lowercase o
64At symbol112Lowercase p
65Uppercase A113Lowercase q
66Uppercase B114Lowercase r
67Uppercase C115Lowercase s
68Uppercase D116Lowercase t
69Uppercase E117Lowercase u
70Uppercase F118Lowercase v
71Uppercase G119Lowercase w
72Uppercase H120Lowercase x
73Uppercase I121Lowercase y
74Uppercase J122Lowercase z
75Uppercase K123Opening brace
76Uppercase L124Vertical bar
77Uppercase M125Closing brace
78Uppercase N126Equivalency sign - tilde
79Uppercase O127Delete

Printable characters along with the output of them used in PRINT statements.

PRINT 'a' + CHAR(32) + 'b'
PRINT CHAR(33)
PRINT CHAR(34)
PRINT CHAR(35)
PRINT CHAR(36)
PRINT CHAR(37)
PRINT CHAR(38)
PRINT CHAR(39)
PRINT CHAR(40)
PRINT CHAR(41)
PRINT CHAR(42)
PRINT CHAR(32)
PRINT CHAR(43)
PRINT CHAR(44)
PRINT CHAR(45)
PRINT CHAR(46)
PRINT CHAR(47)
PRINT CHAR(48)
PRINT CHAR(49)
PRINT CHAR(50)
PRINT CHAR(51)
PRINT CHAR(52)
PRINT CHAR(53)
PRINT CHAR(54)
PRINT CHAR(55)
PRINT CHAR(56)
PRINT CHAR(57)
PRINT CHAR(58)
PRINT CHAR(59)
PRINT CHAR(60)
PRINT CHAR(61)
PRINT CHAR(62)
PRINT CHAR(63)
PRINT CHAR(64)
PRINT CHAR(65)
PRINT CHAR(66)
PRINT CHAR(67)
PRINT CHAR(68)
PRINT CHAR(69)
PRINT CHAR(70)
PRINT CHAR(71)
PRINT CHAR(72)
PRINT CHAR(73)
PRINT CHAR(74)
PRINT CHAR(75)
PRINT CHAR(76)
PRINT CHAR(77)
PRINT CHAR(78)
PRINT CHAR(79)
PRINT CHAR(80)
PRINT CHAR(81)
PRINT CHAR(82)
PRINT CHAR(83)
PRINT CHAR(84)
PRINT CHAR(85)
PRINT CHAR(86)
PRINT CHAR(87)
PRINT CHAR(88)
PRINT CHAR(89)
PRINT CHAR(90)
PRINT CHAR(91)
PRINT CHAR(92)
PRINT CHAR(93)
PRINT CHAR(94)
PRINT CHAR(95)
PRINT CHAR(96)
PRINT CHAR(97)
PRINT CHAR(98)
PRINT CHAR(99)
PRINT CHAR(100)
PRINT CHAR(101)
PRINT CHAR(102)
PRINT CHAR(103)
PRINT CHAR(104)
PRINT CHAR(105)
PRINT CHAR(106)
PRINT CHAR(107)
PRINT CHAR(108)
PRINT CHAR(109)
PRINT CHAR(110)
PRINT CHAR(111)
PRINT CHAR(112)
PRINT CHAR(113)
PRINT CHAR(114)
PRINT CHAR(115)
PRINT CHAR(116)
PRINT CHAR(117)
PRINT CHAR(118)
PRINT CHAR(119)
PRINT CHAR(120)
PRINT CHAR(121)
PRINT CHAR(122)
PRINT CHAR(123)
PRINT CHAR(124)
PRINT CHAR(125)
PRINT CHAR(126)
PRINT CHAR(127)
SQL Server T-SQL CodeResultSQL Server T-SQL CodeResult
PRINT CHAR(32)a bPRINT CHAR(80)P
PRINT CHAR(33)!PRINT CHAR(81)Q
PRINT CHAR(34)PRINT CHAR(82)R
PRINT CHAR(35)#PRINT CHAR(83)S
PRINT CHAR(36)$PRINT CHAR(84)T
PRINT CHAR(37)%PRINT CHAR(85)U
PRINT CHAR(38)&PRINT CHAR(86)V
PRINT CHAR(39)'PRINT CHAR(87)W
PRINT CHAR(40)(PRINT CHAR(88)X
PRINT CHAR(41))PRINT CHAR(89)Y
PRINT CHAR(42)*PRINT CHAR(90)Z
PRINT CHAR(43)+PRINT CHAR(91)[
PRINT CHAR(44),PRINT CHAR(92)\
PRINT CHAR(45)-PRINT CHAR(93)]
PRINT CHAR(46).PRINT CHAR(94) ^
PRINT CHAR(47)/PRINT CHAR(95)_
PRINT CHAR(48)0PRINT CHAR(96) `
PRINT CHAR(49)1PRINT CHAR(97)a
PRINT CHAR(50)2PRINT CHAR(98)b
PRINT CHAR(51)3PRINT CHAR(99)c
PRINT CHAR(52)4PRINT CHAR(100)d
PRINT CHAR(53)5PRINT CHAR(101)e
PRINT CHAR(54)6PRINT CHAR(102)f
PRINT CHAR(55)7PRINT CHAR(103)g
PRINT CHAR(56)8PRINT CHAR(104)h
PRINT CHAR(57)9PRINT CHAR(105)i
PRINT CHAR(58):PRINT CHAR(106)j
PRINT CHAR(59);PRINT CHAR(107)k
PRINT CHAR(60)<PRINT CHAR(108)l
PRINT CHAR(61)=PRINT CHAR(109)m
PRINT CHAR(62)>PRINT CHAR(110)n
PRINT CHAR(63)?PRINT CHAR(111)o
PRINT CHAR(64)@PRINT CHAR(112)p
PRINT CHAR(65)APRINT CHAR(113)q
PRINT CHAR(66)BPRINT CHAR(114)r
PRINT CHAR(67)CPRINT CHAR(115)s
PRINT CHAR(68)DPRINT CHAR(116)t
PRINT CHAR(69)EPRINT CHAR(117)u
PRINT CHAR(70)FPRINT CHAR(118)v
PRINT CHAR(71)GPRINT CHAR(119)w
PRINT CHAR(72)HPRINT CHAR(120)x
PRINT CHAR(73)IPRINT CHAR(121)y
PRINT CHAR(74)JPRINT CHAR(122)z
PRINT CHAR(75)KPRINT CHAR(123){
PRINT CHAR(76)LPRINT CHAR(124)|
PRINT CHAR(77)MPRINT CHAR(125)}
PRINT CHAR(78)NPRINT CHAR(126)~
PRINT CHAR(79)OPRINT CHAR(127)

Extended Characters

ASCII codes 128 through 255 are extended characters which give you an additional 128 characters.

Integer ValueCharacterInteger ValueCharacter
128Euro sign192Latin capital letter A with grave
129 193Latin capital letter A with acute
130Single low-9 quotation mark194Latin capital letter A with circumflex
131Latin small letter f with hook195Latin capital letter A with tilde
132Double low-9 quotation mark196Latin capital letter A with diaeresis
133Horizontal ellipsis197Latin capital letter A with ring above
134Dagger198Latin capital letter AE
135Double dagger199Latin capital letter C with cedilla
136Modifier letter circumflex accent200Latin capital letter E with grave
137Per mille sign201Latin capital letter E with acute
138Latin capital letter S with caron202Latin capital letter E with circumflex
139Single left-pointing angle quotation203Latin capital letter E with diaeresis
140Latin capital ligature OE204Latin capital letter I with grave
141 205Latin capital letter I with acute
142Latin capital letter Z with caron206Latin capital letter I with circumflex
143 207Latin capital letter I with diaeresis
144 208Latin capital letter ETH
145Left single quotation mark209Latin capital letter N with tilde
146Right single quotation mark210Latin capital letter O with grave
147Left double quotation mark211Latin capital letter O with acute
148Right double quotation mark212Latin capital letter O with circumflex
149Bullet213Latin capital letter O with tilde
150En dash214Latin capital letter O with diaeresis
151Em dash215Multiplication sign
152Small tilde216Latin capital letter O with slash
153Trade mark sign217Latin capital letter U with grave
154Latin small letter S with caron218Latin capital letter U with acute
155Single right-pointing angle quotation mark219Latin capital letter U with circumflex
156Latin small ligature oe220Latin capital letter U with diaeresis
157 221Latin capital letter Y with acute
158Latin small letter z with caron222Latin capital letter THORN
159Latin capital letter Y with diaeresis223Latin small letter sharp s - ess-zed
160Non-breaking space224Latin small letter a with grave
161Inverted exclamation mark225Latin small letter a with acute
162Cent sign226Latin small letter a with circumflex
163Pound sign227Latin small letter a with tilde
164Currency sign228Latin small letter a with diaeresis
165Yen sign229Latin small letter a with ring above
166Pipe, Broken vertical bar230Latin small letter ae
167Section sign231Latin small letter c with cedilla
168Spacing diaeresis - umlaut232Latin small letter e with grave
169Copyright sign233Latin small letter e with acute
170Feminine ordinal indicator234Latin small letter e with circumflex
171Left double angle quotes235Latin small letter e with diaeresis
172Not sign236Latin small letter i with grave
173Soft hyphen237Latin small letter i with acute
174Registered trade mark sign238Latin small letter i with circumflex
175Spacing macron - overline239Latin small letter i with diaeresis
176Degree sign240Latin small letter eth
177Plus-or-minus sign241Latin small letter n with tilde
178Superscript two - squared242Latin small letter o with grave
179Superscript three - cubed243Latin small letter o with acute
180Acute accent - spacing acute244Latin small letter o with circumflex
181Micro sign245Latin small letter o with tilde
182Pilcrow sign - paragraph sign246Latin small letter o with diaeresis
183Middle dot - Georgian comma247Division sign
184Spacing cedilla248Latin small letter o with slash
185Superscript one249Latin small letter u with grave
186Masculine ordinal indicator250Latin small letter u with acute
187Right double angle quotes251Latin small letter u with circumflex
188Fraction one quarter252Latin small letter u with diaeresis
189Fraction one half253Latin small letter y with acute
190Fraction three quarters254Latin small letter thorn
191Inverted question mark255Latin small letter y with diaeresis
PRINT CHAR(128)
PRINT CHAR(129)
PRINT CHAR(130)
PRINT CHAR(131)
PRINT CHAR(132)
PRINT CHAR(133)
PRINT CHAR(134)
PRINT CHAR(135)
PRINT CHAR(136)
PRINT CHAR(137)
PRINT CHAR(138)
PRINT CHAR(139)
PRINT CHAR(140)
PRINT CHAR(141)
PRINT CHAR(142)
PRINT CHAR(143)
PRINT CHAR(144)
PRINT CHAR(145)
PRINT CHAR(146)
PRINT CHAR(147)
PRINT CHAR(148)
PRINT CHAR(149)
PRINT CHAR(150)
PRINT CHAR(151)
PRINT CHAR(152)
PRINT CHAR(153)
PRINT CHAR(154)
PRINT CHAR(155)
PRINT CHAR(156)
PRINT CHAR(157)
PRINT CHAR(158)
PRINT CHAR(159)
PRINT CHAR(160)
PRINT CHAR(161)
PRINT CHAR(162)
PRINT CHAR(163)
PRINT CHAR(164)
PRINT CHAR(165)
PRINT CHAR(166)
PRINT CHAR(167)
PRINT CHAR(168)
PRINT CHAR(169)
PRINT CHAR(170)
PRINT CHAR(171)
PRINT CHAR(172)
PRINT CHAR(173)
PRINT CHAR(174)
PRINT CHAR(175)
PRINT CHAR(176)
PRINT CHAR(177)
PRINT CHAR(178)
PRINT CHAR(179)
PRINT CHAR(180)
PRINT CHAR(181)
PRINT CHAR(182)
PRINT CHAR(183)
PRINT CHAR(184)
PRINT CHAR(185)
PRINT CHAR(186)
PRINT CHAR(187)
PRINT CHAR(188)
PRINT CHAR(189)
PRINT CHAR(190)
PRINT CHAR(191)
PRINT CHAR(192)
PRINT CHAR(193)
PRINT CHAR(194)
PRINT CHAR(195)
PRINT CHAR(196)
PRINT CHAR(197)
PRINT CHAR(198)
PRINT CHAR(199)
PRINT CHAR(200)
PRINT CHAR(201)
PRINT CHAR(202)
PRINT CHAR(203)
PRINT CHAR(204)
PRINT CHAR(205)
PRINT CHAR(206)
PRINT CHAR(207)
PRINT CHAR(208)
PRINT CHAR(209)
PRINT CHAR(210)
PRINT CHAR(211)
PRINT CHAR(212)
PRINT CHAR(213)
PRINT CHAR(214)
PRINT CHAR(215)
PRINT CHAR(216)
PRINT CHAR(217)
PRINT CHAR(218)
PRINT CHAR(219)
PRINT CHAR(220)
PRINT CHAR(221)
PRINT CHAR(222)
PRINT CHAR(223)
PRINT CHAR(224)
PRINT CHAR(225)
PRINT CHAR(226)
PRINT CHAR(227)
PRINT CHAR(228)
PRINT CHAR(229)
PRINT CHAR(230)
PRINT CHAR(231)
PRINT CHAR(232)
PRINT CHAR(233)
PRINT CHAR(234)
PRINT CHAR(235)
PRINT CHAR(236)
PRINT CHAR(237)
PRINT CHAR(238)
PRINT CHAR(239)
PRINT CHAR(240)
PRINT CHAR(241)
PRINT CHAR(242)
PRINT CHAR(243)
PRINT CHAR(244)
PRINT CHAR(245)
PRINT CHAR(246)
PRINT CHAR(247)
PRINT CHAR(248)
PRINT CHAR(249)
PRINT CHAR(250)
PRINT CHAR(251)
PRINT CHAR(252)
PRINT CHAR(253)
PRINT CHAR(254)
PRINT CHAR(255)
SQL Server T-SQL CodeResultSQL Server T-SQL CodeResult
PRINT CHAR(128)PRINT CHAR(192)À
PRINT CHAR(129) PRINT CHAR(193)Á
PRINT CHAR(130)PRINT CHAR(194)Â
PRINT CHAR(131)ƒPRINT CHAR(195)Ã
PRINT CHAR(132)PRINT CHAR(196)Ä
PRINT CHAR(133)PRINT CHAR(197)Å
PRINT CHAR(134)PRINT CHAR(198)Æ
PRINT CHAR(135)PRINT CHAR(199)Ç
PRINT CHAR(136)ˆPRINT CHAR(200)È
PRINT CHAR(137)PRINT CHAR(201)É
PRINT CHAR(138)ŠPRINT CHAR(202)Ê
PRINT CHAR(139)PRINT CHAR(203)Ë
PRINT CHAR(140)ŒPRINT CHAR(204)Ì
PRINT CHAR(141) PRINT CHAR(205)Í
PRINT CHAR(142) PRINT CHAR(206)Î
PRINT CHAR(143) PRINT CHAR(207)Ï
PRINT CHAR(144) PRINT CHAR(208)Ð
PRINT CHAR(145)PRINT CHAR(209)Ñ
PRINT CHAR(146)PRINT CHAR(210)Ò
PRINT CHAR(147)PRINT CHAR(211)Ó
PRINT CHAR(148)PRINT CHAR(212)Ô
PRINT CHAR(149)PRINT CHAR(213)Õ
PRINT CHAR(150)PRINT CHAR(214)Ö
PRINT CHAR(151)PRINT CHAR(215)×
PRINT CHAR(152)˜PRINT CHAR(216)Ø
PRINT CHAR(153)PRINT CHAR(217)Ù
PRINT CHAR(154)šPRINT CHAR(218)Ú
PRINT CHAR(155)PRINT CHAR(219)Û
PRINT CHAR(156)œPRINT CHAR(220)Ü
PRINT CHAR(157) PRINT CHAR(221)Ý
PRINT CHAR(158) PRINT CHAR(222)Þ
PRINT CHAR(159)ŸPRINT CHAR(223)ß
PRINT CHAR(160) PRINT CHAR(224)à
PRINT CHAR(161)¡PRINT CHAR(225)á
PRINT CHAR(162)¢PRINT CHAR(226)â
PRINT CHAR(163)£PRINT CHAR(227)ã
PRINT CHAR(164)¤PRINT CHAR(228)ä
PRINT CHAR(165)¥PRINT CHAR(229)å
PRINT CHAR(166)¦PRINT CHAR(230)æ
PRINT CHAR(167)§PRINT CHAR(231)ç
PRINT CHAR(168)¨PRINT CHAR(232)è
PRINT CHAR(169)©PRINT CHAR(233)é
PRINT CHAR(170)ªPRINT CHAR(234)ê
PRINT CHAR(171)«PRINT CHAR(235)ë
PRINT CHAR(172)¬PRINT CHAR(236)ì
PRINT CHAR(173)­PRINT CHAR(237)í
PRINT CHAR(174)®PRINT CHAR(238)î
PRINT CHAR(175)¯PRINT CHAR(239)ï
PRINT CHAR(176)°PRINT CHAR(240)ð
PRINT CHAR(177)±PRINT CHAR(241)ñ
PRINT CHAR(178)²PRINT CHAR(242)ò
PRINT CHAR(179)³PRINT CHAR(243)ó
PRINT CHAR(180)´PRINT CHAR(244)ô
PRINT CHAR(181)µPRINT CHAR(245)õ
PRINT CHAR(182)PRINT CHAR(246)ö
PRINT CHAR(183)·PRINT CHAR(247)÷
PRINT CHAR(184)¸PRINT CHAR(248)ø
PRINT CHAR(185)¹PRINT CHAR(249)ù
PRINT CHAR(186)ºPRINT CHAR(250)ú
PRINT CHAR(187)»PRINT CHAR(251)û
PRINT CHAR(188)¼PRINT CHAR(252)ü
PRINT CHAR(189)½PRINT CHAR(253)ý
PRINT CHAR(190)¾PRINT CHAR(254)þ
PRINT CHAR(191)¿PRINT CHAR(255)ÿ
microsoft/microsoft_sql_server/sql/char_function.txt · Last modified: 2021/08/05 14:23 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki