SHARE
TWEET

Unicode 3.2, Part 2: Derived Props (Alpha & Dec)

SqlQuantumLeap Mar 26th, 2018 (edited) 10 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.  --------- Unicode 3.2, Part 2: Derived Props (Alpha & Dec) ---------
  3.  
  4. Created By: Solomon Rutzky
  5. Created On: 2018-03-27
  6. Updated On: n/a
  7.  
  8. Location:          https://pastebin.com/edit/qjEc7zvH
  9. Related blog post: https://SqlQuantumLeap.com/2018/04/02/the-uni-code-the-search-for-the-true-list-of-valid-characters-for-t-sql-regular-identifiers-part-1/
  10.  
  11. DESCRIPTION: This script adds and populates the "IsAlphabetic" and "IsDecimal" columns.
  12.              The list of code points having the "Alphabetic" property is found in the
  13.              text file noted below under "SOURCE DATA". The code points that have the
  14.              "Decimal Number" property can be derived from the main
  15.              "UnicodeCharacterDatabase" table using the algorithm found on the
  16.              https://www.unicode.org/Public/3.2-Update/DerivedProperties-3.2.0.html
  17.              page, in the "Derived Extracted Properties" chart, under "DerivedNumericType".
  18.  
  19.              As with the main "UnicodeCharacterDatabase" table, we are only concerned
  20.              with just the BMP code points (i.e. the U+0000 through U+FFFF range).
  21.  
  22. REQUIREMENTS:
  23.     1) SQL Server 2005 or newer
  24.     2) Unicode 3.2, Part 1: Unicode Character Database (UCD)
  25.        found at: https://pastebin.com/Vj1HFg1v
  26.  
  27. SOURCE DATA: https://www.unicode.org/Public/3.2-Update/DerivedCoreProperties-3.2.0.txt
  28.  
  29. Copyright © 1991-2018 Unicode, Inc. All rights reserved.
  30. Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
  31.  
  32. Permission is hereby granted, free of charge, to any person obtaining
  33. a copy of the Unicode data files and any associated documentation
  34. (the "Data Files") or Unicode software and any associated documentation
  35. (the "Software") to deal in the Data Files or Software
  36. without restriction, including without limitation the rights to use,
  37. copy, modify, merge, publish, distribute, and/or sell copies of
  38. the Data Files or Software, and to permit persons to whom the Data Files
  39. or Software are furnished to do so, provided that either
  40. (a) this copyright and permission notice appear with all copies
  41. of the Data Files or Software, or
  42. (b) this copyright and permission notice appear in associated
  43. Documentation.
  44.  
  45. THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
  46. ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  47. WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  48. NONINFRINGEMENT OF THIRD PARTY RIGHTS.
  49. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
  50. NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
  51. DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  52. DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  53. TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  54. PERFORMANCE OF THE DATA FILES OR SOFTWARE.
  55.  
  56. Except as contained in this notice, the name of a copyright holder
  57. shall not be used in advertising or otherwise to promote the sale,
  58. use or other dealings in these Data Files or Software without prior
  59. written authorization of the copyright holder.
  60. */
  61.  
  62.  
  63. USE [UnicodeTesting];
  64.  
  65. SET NOCOUNT ON;
  66.  
  67.  
  68.  
  69.  
  70. IF (OBJECT_ID(N'[v3-2].UnicodeCharacterDatabase') IS NULL)
  71. BEGIN
  72.     RAISERROR('
  73.     Missing the main "UnicodeCharacterDatabase" table.
  74.     Please load that first. You can get it from:
  75.     https://pastebin.com/Vj1HFg1v', 16, 1);
  76.     RETURN;
  77. END;
  78.  
  79. BEGIN TRAN;
  80.  
  81.  
  82. BEGIN TRY
  83.  
  84.     -----------------------------------------------------------------------
  85.     -- Add and populate: "IsAlphabetic"
  86.     -----------------------------------
  87.  
  88. IF (NOT EXISTS(
  89.         SELECT *
  90.         FROM   sys.columns sc
  91.         WHERE  sc.[object_id] = OBJECT_ID(N'[v3-2].UnicodeCharacterDatabase')
  92.         AND    sc.[name] = N'IsAlphabetic'))
  93. BEGIN
  94.     ALTER TABLE [v3-2].UnicodeCharacterDatabase
  95.         ADD [IsAlphabetic] BIT NULL;
  96. END;
  97.  
  98.  
  99. EXEC (N'
  100. UPDATE ucd
  101. SET    ucd.[IsAlphabetic] = 1
  102. -- SELECT *
  103. FROM   [v3-2].UnicodeCharacterDatabase ucd
  104. WHERE  1 = 0
  105. OR ucd.[CodePoint] BETWEEN 0x0041 AND 0x005A
  106. OR ucd.[CodePoint] BETWEEN 0x0061 AND 0x007A
  107. OR ucd.[CodePoint] = 0x00AA
  108. OR ucd.[CodePoint] = 0x00B5
  109. OR ucd.[CodePoint] = 0x00BA
  110. OR ucd.[CodePoint] BETWEEN 0x00C0 AND 0x00D6
  111. OR ucd.[CodePoint] BETWEEN 0x00D8 AND 0x00F6
  112. OR ucd.[CodePoint] BETWEEN 0x00F8 AND 0x01BA
  113. OR ucd.[CodePoint] = 0x01BB
  114. OR ucd.[CodePoint] BETWEEN 0x01BC AND 0x01BF
  115. OR ucd.[CodePoint] BETWEEN 0x01C0 AND 0x01C3
  116. OR ucd.[CodePoint] BETWEEN 0x01C4 AND 0x0220
  117. OR ucd.[CodePoint] BETWEEN 0x0222 AND 0x0233
  118. OR ucd.[CodePoint] BETWEEN 0x0250 AND 0x02AD
  119. OR ucd.[CodePoint] BETWEEN 0x02B0 AND 0x02B8
  120. OR ucd.[CodePoint] BETWEEN 0x02BB AND 0x02C1
  121. OR ucd.[CodePoint] BETWEEN 0x02D0 AND 0x02D1
  122. OR ucd.[CodePoint] BETWEEN 0x02E0 AND 0x02E4
  123. OR ucd.[CodePoint] = 0x02EE
  124. OR ucd.[CodePoint] = 0x0345
  125. OR ucd.[CodePoint] = 0x037A
  126. OR ucd.[CodePoint] = 0x0386
  127. OR ucd.[CodePoint] BETWEEN 0x0388 AND 0x038A
  128. OR ucd.[CodePoint] = 0x038C
  129. OR ucd.[CodePoint] BETWEEN 0x038E AND 0x03A1
  130. OR ucd.[CodePoint] BETWEEN 0x03A3 AND 0x03CE
  131. OR ucd.[CodePoint] BETWEEN 0x03D0 AND 0x03F5
  132. OR ucd.[CodePoint] BETWEEN 0x0400 AND 0x0481
  133. OR ucd.[CodePoint] BETWEEN 0x048A AND 0x04CE
  134. OR ucd.[CodePoint] BETWEEN 0x04D0 AND 0x04F5
  135. OR ucd.[CodePoint] BETWEEN 0x04F8 AND 0x04F9
  136. OR ucd.[CodePoint] BETWEEN 0x0500 AND 0x050F
  137. OR ucd.[CodePoint] BETWEEN 0x0531 AND 0x0556
  138. OR ucd.[CodePoint] = 0x0559
  139. OR ucd.[CodePoint] BETWEEN 0x0561 AND 0x0587
  140. OR ucd.[CodePoint] BETWEEN 0x05B0 AND 0x05B9
  141. OR ucd.[CodePoint] BETWEEN 0x05BB AND 0x05BD
  142. OR ucd.[CodePoint] = 0x05BF
  143. OR ucd.[CodePoint] BETWEEN 0x05C1 AND 0x05C2
  144. OR ucd.[CodePoint] = 0x05C4
  145. OR ucd.[CodePoint] BETWEEN 0x05D0 AND 0x05EA
  146. OR ucd.[CodePoint] BETWEEN 0x05F0 AND 0x05F2
  147. OR ucd.[CodePoint] BETWEEN 0x0621 AND 0x063A
  148. OR ucd.[CodePoint] = 0x0640
  149. OR ucd.[CodePoint] BETWEEN 0x0641 AND 0x064A
  150. OR ucd.[CodePoint] BETWEEN 0x064B AND 0x0655
  151. OR ucd.[CodePoint] BETWEEN 0x066E AND 0x066F
  152. OR ucd.[CodePoint] = 0x0670
  153. OR ucd.[CodePoint] BETWEEN 0x0671 AND 0x06D3
  154. OR ucd.[CodePoint] = 0x06D5
  155. OR ucd.[CodePoint] BETWEEN 0x06D6 AND 0x06DC
  156. OR ucd.[CodePoint] BETWEEN 0x06E1 AND 0x06E4
  157. OR ucd.[CodePoint] BETWEEN 0x06E5 AND 0x06E6
  158. OR ucd.[CodePoint] BETWEEN 0x06E7 AND 0x06E8
  159. OR ucd.[CodePoint] = 0x06ED
  160. OR ucd.[CodePoint] BETWEEN 0x06FA AND 0x06FC
  161. OR ucd.[CodePoint] = 0x0710
  162. OR ucd.[CodePoint] = 0x0711
  163. OR ucd.[CodePoint] BETWEEN 0x0712 AND 0x072C
  164. OR ucd.[CodePoint] BETWEEN 0x0730 AND 0x073F
  165. OR ucd.[CodePoint] BETWEEN 0x0780 AND 0x07A5
  166. OR ucd.[CodePoint] BETWEEN 0x07A6 AND 0x07B0
  167. OR ucd.[CodePoint] = 0x07B1
  168. OR ucd.[CodePoint] BETWEEN 0x0901 AND 0x0902
  169. OR ucd.[CodePoint] = 0x0903
  170. OR ucd.[CodePoint] BETWEEN 0x0905 AND 0x0939
  171. OR ucd.[CodePoint] = 0x093D
  172. OR ucd.[CodePoint] BETWEEN 0x093E AND 0x0940
  173. OR ucd.[CodePoint] BETWEEN 0x0941 AND 0x0948
  174. OR ucd.[CodePoint] BETWEEN 0x0949 AND 0x094C
  175. OR ucd.[CodePoint] = 0x0950
  176. OR ucd.[CodePoint] BETWEEN 0x0958 AND 0x0961
  177. OR ucd.[CodePoint] BETWEEN 0x0962 AND 0x0963
  178. OR ucd.[CodePoint] = 0x0981
  179. OR ucd.[CodePoint] BETWEEN 0x0982 AND 0x0983
  180. OR ucd.[CodePoint] BETWEEN 0x0985 AND 0x098C
  181. OR ucd.[CodePoint] BETWEEN 0x098F AND 0x0990
  182. OR ucd.[CodePoint] BETWEEN 0x0993 AND 0x09A8
  183. OR ucd.[CodePoint] BETWEEN 0x09AA AND 0x09B0
  184. OR ucd.[CodePoint] = 0x09B2
  185. OR ucd.[CodePoint] BETWEEN 0x09B6 AND 0x09B9
  186. OR ucd.[CodePoint] BETWEEN 0x09BE AND 0x09C0
  187. OR ucd.[CodePoint] BETWEEN 0x09C1 AND 0x09C4
  188. OR ucd.[CodePoint] BETWEEN 0x09C7 AND 0x09C8
  189. OR ucd.[CodePoint] BETWEEN 0x09CB AND 0x09CC
  190. OR ucd.[CodePoint] = 0x09D7
  191. OR ucd.[CodePoint] BETWEEN 0x09DC AND 0x09DD
  192. OR ucd.[CodePoint] BETWEEN 0x09DF AND 0x09E1
  193. OR ucd.[CodePoint] BETWEEN 0x09E2 AND 0x09E3
  194. OR ucd.[CodePoint] BETWEEN 0x09F0 AND 0x09F1
  195. OR ucd.[CodePoint] = 0x0A02
  196. OR ucd.[CodePoint] BETWEEN 0x0A05 AND 0x0A0A
  197. OR ucd.[CodePoint] BETWEEN 0x0A0F AND 0x0A10
  198. OR ucd.[CodePoint] BETWEEN 0x0A13 AND 0x0A28
  199. OR ucd.[CodePoint] BETWEEN 0x0A2A AND 0x0A30
  200. OR ucd.[CodePoint] BETWEEN 0x0A32 AND 0x0A33
  201. OR ucd.[CodePoint] BETWEEN 0x0A35 AND 0x0A36
  202. OR ucd.[CodePoint] BETWEEN 0x0A38 AND 0x0A39
  203. OR ucd.[CodePoint] BETWEEN 0x0A3E AND 0x0A40
  204. OR ucd.[CodePoint] BETWEEN 0x0A41 AND 0x0A42
  205. OR ucd.[CodePoint] BETWEEN 0x0A47 AND 0x0A48
  206. OR ucd.[CodePoint] BETWEEN 0x0A4B AND 0x0A4C
  207. OR ucd.[CodePoint] BETWEEN 0x0A59 AND 0x0A5C
  208. OR ucd.[CodePoint] = 0x0A5E
  209. OR ucd.[CodePoint] BETWEEN 0x0A70 AND 0x0A71
  210. OR ucd.[CodePoint] BETWEEN 0x0A72 AND 0x0A74
  211. OR ucd.[CodePoint] BETWEEN 0x0A81 AND 0x0A82
  212. OR ucd.[CodePoint] = 0x0A83
  213. OR ucd.[CodePoint] BETWEEN 0x0A85 AND 0x0A8B
  214. OR ucd.[CodePoint] = 0x0A8D
  215. OR ucd.[CodePoint] BETWEEN 0x0A8F AND 0x0A91
  216. OR ucd.[CodePoint] BETWEEN 0x0A93 AND 0x0AA8
  217. OR ucd.[CodePoint] BETWEEN 0x0AAA AND 0x0AB0
  218. OR ucd.[CodePoint] BETWEEN 0x0AB2 AND 0x0AB3
  219. OR ucd.[CodePoint] BETWEEN 0x0AB5 AND 0x0AB9
  220. OR ucd.[CodePoint] = 0x0ABD
  221. OR ucd.[CodePoint] BETWEEN 0x0ABE AND 0x0AC0
  222. OR ucd.[CodePoint] BETWEEN 0x0AC1 AND 0x0AC5
  223. OR ucd.[CodePoint] BETWEEN 0x0AC7 AND 0x0AC8
  224. OR ucd.[CodePoint] = 0x0AC9
  225. OR ucd.[CodePoint] BETWEEN 0x0ACB AND 0x0ACC
  226. OR ucd.[CodePoint] = 0x0AD0
  227. OR ucd.[CodePoint] = 0x0AE0
  228. OR ucd.[CodePoint] = 0x0B01
  229. OR ucd.[CodePoint] BETWEEN 0x0B02 AND 0x0B03
  230. OR ucd.[CodePoint] BETWEEN 0x0B05 AND 0x0B0C
  231. OR ucd.[CodePoint] BETWEEN 0x0B0F AND 0x0B10
  232. OR ucd.[CodePoint] BETWEEN 0x0B13 AND 0x0B28
  233. OR ucd.[CodePoint] BETWEEN 0x0B2A AND 0x0B30
  234. OR ucd.[CodePoint] BETWEEN 0x0B32 AND 0x0B33
  235. OR ucd.[CodePoint] BETWEEN 0x0B36 AND 0x0B39
  236. OR ucd.[CodePoint] = 0x0B3D
  237. OR ucd.[CodePoint] = 0x0B3E
  238. OR ucd.[CodePoint] = 0x0B3F
  239. OR ucd.[CodePoint] = 0x0B40
  240. OR ucd.[CodePoint] BETWEEN 0x0B41 AND 0x0B43
  241. OR ucd.[CodePoint] BETWEEN 0x0B47 AND 0x0B48
  242. OR ucd.[CodePoint] BETWEEN 0x0B4B AND 0x0B4C
  243. OR ucd.[CodePoint] = 0x0B56
  244. OR ucd.[CodePoint] = 0x0B57
  245. OR ucd.[CodePoint] BETWEEN 0x0B5C AND 0x0B5D
  246. OR ucd.[CodePoint] BETWEEN 0x0B5F AND 0x0B61
  247. OR ucd.[CodePoint] = 0x0B82
  248. OR ucd.[CodePoint] = 0x0B83
  249. OR ucd.[CodePoint] BETWEEN 0x0B85 AND 0x0B8A
  250. OR ucd.[CodePoint] BETWEEN 0x0B8E AND 0x0B90
  251. OR ucd.[CodePoint] BETWEEN 0x0B92 AND 0x0B95
  252. OR ucd.[CodePoint] BETWEEN 0x0B99 AND 0x0B9A
  253. OR ucd.[CodePoint] = 0x0B9C
  254. OR ucd.[CodePoint] BETWEEN 0x0B9E AND 0x0B9F
  255. OR ucd.[CodePoint] BETWEEN 0x0BA3 AND 0x0BA4
  256. OR ucd.[CodePoint] BETWEEN 0x0BA8 AND 0x0BAA
  257. OR ucd.[CodePoint] BETWEEN 0x0BAE AND 0x0BB5
  258. OR ucd.[CodePoint] BETWEEN 0x0BB7 AND 0x0BB9
  259. OR ucd.[CodePoint] BETWEEN 0x0BBE AND 0x0BBF
  260. OR ucd.[CodePoint] = 0x0BC0
  261. OR ucd.[CodePoint] BETWEEN 0x0BC1 AND 0x0BC2
  262. OR ucd.[CodePoint] BETWEEN 0x0BC6 AND 0x0BC8
  263. OR ucd.[CodePoint] BETWEEN 0x0BCA AND 0x0BCC
  264. OR ucd.[CodePoint] = 0x0BD7
  265. OR ucd.[CodePoint] BETWEEN 0x0C01 AND 0x0C03
  266. OR ucd.[CodePoint] BETWEEN 0x0C05 AND 0x0C0C
  267. OR ucd.[CodePoint] BETWEEN 0x0C0E AND 0x0C10
  268. OR ucd.[CodePoint] BETWEEN 0x0C12 AND 0x0C28
  269. OR ucd.[CodePoint] BETWEEN 0x0C2A AND 0x0C33
  270. OR ucd.[CodePoint] BETWEEN 0x0C35 AND 0x0C39
  271. OR ucd.[CodePoint] BETWEEN 0x0C3E AND 0x0C40
  272. OR ucd.[CodePoint] BETWEEN 0x0C41 AND 0x0C44
  273. OR ucd.[CodePoint] BETWEEN 0x0C46 AND 0x0C48
  274. OR ucd.[CodePoint] BETWEEN 0x0C4A AND 0x0C4C
  275. OR ucd.[CodePoint] BETWEEN 0x0C55 AND 0x0C56
  276. OR ucd.[CodePoint] BETWEEN 0x0C60 AND 0x0C61
  277. OR ucd.[CodePoint] BETWEEN 0x0C82 AND 0x0C83
  278. OR ucd.[CodePoint] BETWEEN 0x0C85 AND 0x0C8C
  279. OR ucd.[CodePoint] BETWEEN 0x0C8E AND 0x0C90
  280. OR ucd.[CodePoint] BETWEEN 0x0C92 AND 0x0CA8
  281. OR ucd.[CodePoint] BETWEEN 0x0CAA AND 0x0CB3
  282. OR ucd.[CodePoint] BETWEEN 0x0CB5 AND 0x0CB9
  283. OR ucd.[CodePoint] = 0x0CBE
  284. OR ucd.[CodePoint] = 0x0CBF
  285. OR ucd.[CodePoint] BETWEEN 0x0CC0 AND 0x0CC4
  286. OR ucd.[CodePoint] = 0x0CC6
  287. OR ucd.[CodePoint] BETWEEN 0x0CC7 AND 0x0CC8
  288. OR ucd.[CodePoint] BETWEEN 0x0CCA AND 0x0CCB
  289. OR ucd.[CodePoint] = 0x0CCC
  290. OR ucd.[CodePoint] BETWEEN 0x0CD5 AND 0x0CD6
  291. OR ucd.[CodePoint] = 0x0CDE
  292. OR ucd.[CodePoint] BETWEEN 0x0CE0 AND 0x0CE1
  293. OR ucd.[CodePoint] BETWEEN 0x0D02 AND 0x0D03
  294. OR ucd.[CodePoint] BETWEEN 0x0D05 AND 0x0D0C
  295. OR ucd.[CodePoint] BETWEEN 0x0D0E AND 0x0D10
  296. OR ucd.[CodePoint] BETWEEN 0x0D12 AND 0x0D28
  297. OR ucd.[CodePoint] BETWEEN 0x0D2A AND 0x0D39
  298. OR ucd.[CodePoint] BETWEEN 0x0D3E AND 0x0D40
  299. OR ucd.[CodePoint] BETWEEN 0x0D41 AND 0x0D43
  300. OR ucd.[CodePoint] BETWEEN 0x0D46 AND 0x0D48
  301. OR ucd.[CodePoint] BETWEEN 0x0D4A AND 0x0D4C
  302. OR ucd.[CodePoint] = 0x0D57
  303. OR ucd.[CodePoint] BETWEEN 0x0D60 AND 0x0D61
  304. OR ucd.[CodePoint] BETWEEN 0x0D82 AND 0x0D83
  305. OR ucd.[CodePoint] BETWEEN 0x0D85 AND 0x0D96
  306. OR ucd.[CodePoint] BETWEEN 0x0D9A AND 0x0DB1
  307. OR ucd.[CodePoint] BETWEEN 0x0DB3 AND 0x0DBB
  308. OR ucd.[CodePoint] = 0x0DBD
  309. OR ucd.[CodePoint] BETWEEN 0x0DC0 AND 0x0DC6
  310. OR ucd.[CodePoint] BETWEEN 0x0DCF AND 0x0DD1
  311. OR ucd.[CodePoint] BETWEEN 0x0DD2 AND 0x0DD4
  312. OR ucd.[CodePoint] = 0x0DD6
  313. OR ucd.[CodePoint] BETWEEN 0x0DD8 AND 0x0DDF
  314. OR ucd.[CodePoint] BETWEEN 0x0DF2 AND 0x0DF3
  315. OR ucd.[CodePoint] BETWEEN 0x0E01 AND 0x0E30
  316. OR ucd.[CodePoint] = 0x0E31
  317. OR ucd.[CodePoint] BETWEEN 0x0E32 AND 0x0E33
  318. OR ucd.[CodePoint] BETWEEN 0x0E34 AND 0x0E3A
  319. OR ucd.[CodePoint] BETWEEN 0x0E40 AND 0x0E45
  320. OR ucd.[CodePoint] = 0x0E46
  321. OR ucd.[CodePoint] = 0x0E4D
  322. OR ucd.[CodePoint] BETWEEN 0x0E81 AND 0x0E82
  323. OR ucd.[CodePoint] = 0x0E84
  324. OR ucd.[CodePoint] BETWEEN 0x0E87 AND 0x0E88
  325. OR ucd.[CodePoint] = 0x0E8A
  326. OR ucd.[CodePoint] = 0x0E8D
  327. OR ucd.[CodePoint] BETWEEN 0x0E94 AND 0x0E97
  328. OR ucd.[CodePoint] BETWEEN 0x0E99 AND 0x0E9F
  329. OR ucd.[CodePoint] BETWEEN 0x0EA1 AND 0x0EA3
  330. OR ucd.[CodePoint] = 0x0EA5
  331. OR ucd.[CodePoint] = 0x0EA7
  332. OR ucd.[CodePoint] BETWEEN 0x0EAA AND 0x0EAB
  333. OR ucd.[CodePoint] BETWEEN 0x0EAD AND 0x0EB0
  334. OR ucd.[CodePoint] = 0x0EB1
  335. OR ucd.[CodePoint] BETWEEN 0x0EB2 AND 0x0EB3
  336. OR ucd.[CodePoint] BETWEEN 0x0EB4 AND 0x0EB9
  337. OR ucd.[CodePoint] BETWEEN 0x0EBB AND 0x0EBC
  338. OR ucd.[CodePoint] = 0x0EBD
  339. OR ucd.[CodePoint] BETWEEN 0x0EC0 AND 0x0EC4
  340. OR ucd.[CodePoint] = 0x0EC6
  341. OR ucd.[CodePoint] = 0x0ECD
  342. OR ucd.[CodePoint] BETWEEN 0x0EDC AND 0x0EDD
  343. OR ucd.[CodePoint] = 0x0F00
  344. OR ucd.[CodePoint] BETWEEN 0x0F40 AND 0x0F47
  345. OR ucd.[CodePoint] BETWEEN 0x0F49 AND 0x0F6A
  346. OR ucd.[CodePoint] BETWEEN 0x0F71 AND 0x0F7E
  347. OR ucd.[CodePoint] = 0x0F7F
  348. OR ucd.[CodePoint] BETWEEN 0x0F80 AND 0x0F81
  349. OR ucd.[CodePoint] BETWEEN 0x0F88 AND 0x0F8B
  350. OR ucd.[CodePoint] BETWEEN 0x0F90 AND 0x0F97
  351. OR ucd.[CodePoint] BETWEEN 0x0F99 AND 0x0FBC
  352. OR ucd.[CodePoint] BETWEEN 0x1000 AND 0x1021
  353. OR ucd.[CodePoint] BETWEEN 0x1023 AND 0x1027
  354. OR ucd.[CodePoint] BETWEEN 0x1029 AND 0x102A
  355. OR ucd.[CodePoint] = 0x102C
  356. OR ucd.[CodePoint] BETWEEN 0x102D AND 0x1030
  357. OR ucd.[CodePoint] = 0x1031
  358. OR ucd.[CodePoint] = 0x1032
  359. OR ucd.[CodePoint] = 0x1036
  360. OR ucd.[CodePoint] = 0x1038
  361. OR ucd.[CodePoint] BETWEEN 0x1050 AND 0x1055
  362. OR ucd.[CodePoint] BETWEEN 0x1056 AND 0x1057
  363. OR ucd.[CodePoint] BETWEEN 0x1058 AND 0x1059
  364. OR ucd.[CodePoint] BETWEEN 0x10A0 AND 0x10C5
  365. OR ucd.[CodePoint] BETWEEN 0x10D0 AND 0x10F8
  366. OR ucd.[CodePoint] BETWEEN 0x1100 AND 0x1159
  367. OR ucd.[CodePoint] BETWEEN 0x115F AND 0x11A2
  368. OR ucd.[CodePoint] BETWEEN 0x11A8 AND 0x11F9
  369. OR ucd.[CodePoint] BETWEEN 0x1200 AND 0x1206
  370. OR ucd.[CodePoint] BETWEEN 0x1208 AND 0x1246
  371. OR ucd.[CodePoint] = 0x1248
  372. OR ucd.[CodePoint] BETWEEN 0x124A AND 0x124D
  373. OR ucd.[CodePoint] BETWEEN 0x1250 AND 0x1256
  374. OR ucd.[CodePoint] = 0x1258
  375. OR ucd.[CodePoint] BETWEEN 0x125A AND 0x125D
  376. OR ucd.[CodePoint] BETWEEN 0x1260 AND 0x1286
  377. OR ucd.[CodePoint] = 0x1288
  378. OR ucd.[CodePoint] BETWEEN 0x128A AND 0x128D
  379. OR ucd.[CodePoint] BETWEEN 0x1290 AND 0x12AE
  380. OR ucd.[CodePoint] = 0x12B0
  381. OR ucd.[CodePoint] BETWEEN 0x12B2 AND 0x12B5
  382. OR ucd.[CodePoint] BETWEEN 0x12B8 AND 0x12BE
  383. OR ucd.[CodePoint] = 0x12C0
  384. OR ucd.[CodePoint] BETWEEN 0x12C2 AND 0x12C5
  385. OR ucd.[CodePoint] BETWEEN 0x12C8 AND 0x12CE
  386. OR ucd.[CodePoint] BETWEEN 0x12D0 AND 0x12D6
  387. OR ucd.[CodePoint] BETWEEN 0x12D8 AND 0x12EE
  388. OR ucd.[CodePoint] BETWEEN 0x12F0 AND 0x130E
  389. OR ucd.[CodePoint] = 0x1310
  390. OR ucd.[CodePoint] BETWEEN 0x1312 AND 0x1315
  391. OR ucd.[CodePoint] BETWEEN 0x1318 AND 0x131E
  392. OR ucd.[CodePoint] BETWEEN 0x1320 AND 0x1346
  393. OR ucd.[CodePoint] BETWEEN 0x1348 AND 0x135A
  394. OR ucd.[CodePoint] BETWEEN 0x13A0 AND 0x13F4
  395. OR ucd.[CodePoint] BETWEEN 0x1401 AND 0x166C
  396. OR ucd.[CodePoint] BETWEEN 0x166F AND 0x1676
  397. OR ucd.[CodePoint] BETWEEN 0x1681 AND 0x169A
  398. OR ucd.[CodePoint] BETWEEN 0x16A0 AND 0x16EA
  399. OR ucd.[CodePoint] BETWEEN 0x16EE AND 0x16F0
  400. OR ucd.[CodePoint] BETWEEN 0x1700 AND 0x170C
  401. OR ucd.[CodePoint] BETWEEN 0x170E AND 0x1711
  402. OR ucd.[CodePoint] BETWEEN 0x1712 AND 0x1713
  403. OR ucd.[CodePoint] BETWEEN 0x1720 AND 0x1731
  404. OR ucd.[CodePoint] BETWEEN 0x1732 AND 0x1733
  405. OR ucd.[CodePoint] BETWEEN 0x1740 AND 0x1751
  406. OR ucd.[CodePoint] BETWEEN 0x1752 AND 0x1753
  407. OR ucd.[CodePoint] BETWEEN 0x1760 AND 0x176C
  408. OR ucd.[CodePoint] BETWEEN 0x176E AND 0x1770
  409. OR ucd.[CodePoint] BETWEEN 0x1772 AND 0x1773
  410. OR ucd.[CodePoint] BETWEEN 0x1780 AND 0x17B3
  411. OR ucd.[CodePoint] BETWEEN 0x17B4 AND 0x17B6
  412. OR ucd.[CodePoint] BETWEEN 0x17B7 AND 0x17BD
  413. OR ucd.[CodePoint] BETWEEN 0x17BE AND 0x17C5
  414. OR ucd.[CodePoint] = 0x17C6
  415. OR ucd.[CodePoint] BETWEEN 0x17C7 AND 0x17C8
  416. OR ucd.[CodePoint] = 0x17D7
  417. OR ucd.[CodePoint] = 0x17DC
  418. OR ucd.[CodePoint] BETWEEN 0x1820 AND 0x1842
  419. OR ucd.[CodePoint] = 0x1843
  420. OR ucd.[CodePoint] BETWEEN 0x1844 AND 0x1877
  421. OR ucd.[CodePoint] BETWEEN 0x1880 AND 0x18A8
  422. OR ucd.[CodePoint] = 0x18A9
  423. OR ucd.[CodePoint] BETWEEN 0x1E00 AND 0x1E9B
  424. OR ucd.[CodePoint] BETWEEN 0x1EA0 AND 0x1EF9
  425. OR ucd.[CodePoint] BETWEEN 0x1F00 AND 0x1F15
  426. OR ucd.[CodePoint] BETWEEN 0x1F18 AND 0x1F1D
  427. OR ucd.[CodePoint] BETWEEN 0x1F20 AND 0x1F45
  428. OR ucd.[CodePoint] BETWEEN 0x1F48 AND 0x1F4D
  429. OR ucd.[CodePoint] BETWEEN 0x1F50 AND 0x1F57
  430. OR ucd.[CodePoint] = 0x1F59
  431. OR ucd.[CodePoint] = 0x1F5B
  432. OR ucd.[CodePoint] = 0x1F5D
  433. OR ucd.[CodePoint] BETWEEN 0x1F5F AND 0x1F7D
  434. OR ucd.[CodePoint] BETWEEN 0x1F80 AND 0x1FB4
  435. OR ucd.[CodePoint] BETWEEN 0x1FB6 AND 0x1FBC
  436. OR ucd.[CodePoint] = 0x1FBE
  437. OR ucd.[CodePoint] BETWEEN 0x1FC2 AND 0x1FC4
  438. OR ucd.[CodePoint] BETWEEN 0x1FC6 AND 0x1FCC
  439. OR ucd.[CodePoint] BETWEEN 0x1FD0 AND 0x1FD3
  440. OR ucd.[CodePoint] BETWEEN 0x1FD6 AND 0x1FDB
  441. OR ucd.[CodePoint] BETWEEN 0x1FE0 AND 0x1FEC
  442. OR ucd.[CodePoint] BETWEEN 0x1FF2 AND 0x1FF4
  443. OR ucd.[CodePoint] BETWEEN 0x1FF6 AND 0x1FFC
  444. OR ucd.[CodePoint] = 0x2071
  445. OR ucd.[CodePoint] = 0x207F
  446. OR ucd.[CodePoint] = 0x2102
  447. OR ucd.[CodePoint] = 0x2107
  448. OR ucd.[CodePoint] BETWEEN 0x210A AND 0x2113
  449. OR ucd.[CodePoint] = 0x2115
  450. OR ucd.[CodePoint] BETWEEN 0x2119 AND 0x211D
  451. OR ucd.[CodePoint] = 0x2124
  452. OR ucd.[CodePoint] = 0x2126
  453. OR ucd.[CodePoint] = 0x2128
  454. OR ucd.[CodePoint] BETWEEN 0x212A AND 0x212D
  455. OR ucd.[CodePoint] BETWEEN 0x212F AND 0x2131
  456. OR ucd.[CodePoint] BETWEEN 0x2133 AND 0x2134
  457. OR ucd.[CodePoint] BETWEEN 0x2135 AND 0x2138
  458. OR ucd.[CodePoint] = 0x2139
  459. OR ucd.[CodePoint] BETWEEN 0x213D AND 0x213F
  460. OR ucd.[CodePoint] BETWEEN 0x2145 AND 0x2149
  461. OR ucd.[CodePoint] BETWEEN 0x2160 AND 0x2183
  462. OR ucd.[CodePoint] = 0x3005
  463. OR ucd.[CodePoint] = 0x3006
  464. OR ucd.[CodePoint] = 0x3007
  465. OR ucd.[CodePoint] BETWEEN 0x3021 AND 0x3029
  466. OR ucd.[CodePoint] BETWEEN 0x3031 AND 0x3035
  467. OR ucd.[CodePoint] BETWEEN 0x3038 AND 0x303A
  468. OR ucd.[CodePoint] = 0x303B
  469. OR ucd.[CodePoint] = 0x303C
  470. OR ucd.[CodePoint] BETWEEN 0x3041 AND 0x3096
  471. OR ucd.[CodePoint] BETWEEN 0x309D AND 0x309E
  472. OR ucd.[CodePoint] = 0x309F
  473. OR ucd.[CodePoint] BETWEEN 0x30A1 AND 0x30FA
  474. OR ucd.[CodePoint] BETWEEN 0x30FC AND 0x30FE
  475. OR ucd.[CodePoint] = 0x30FF
  476. OR ucd.[CodePoint] BETWEEN 0x3105 AND 0x312C
  477. OR ucd.[CodePoint] BETWEEN 0x3131 AND 0x318E
  478. OR ucd.[CodePoint] BETWEEN 0x31A0 AND 0x31B7
  479. OR ucd.[CodePoint] BETWEEN 0x31F0 AND 0x31FF
  480. OR ucd.[CodePoint] BETWEEN 0x3400 AND 0x4DB5
  481. OR ucd.[CodePoint] BETWEEN 0x4E00 AND 0x9FA5
  482. OR ucd.[CodePoint] BETWEEN 0xA000 AND 0xA48C
  483. OR ucd.[CodePoint] BETWEEN 0xAC00 AND 0xD7A3
  484. OR ucd.[CodePoint] BETWEEN 0xF900 AND 0xFA2D
  485. OR ucd.[CodePoint] BETWEEN 0xFA30 AND 0xFA6A
  486. OR ucd.[CodePoint] BETWEEN 0xFB00 AND 0xFB06
  487. OR ucd.[CodePoint] BETWEEN 0xFB13 AND 0xFB17
  488. OR ucd.[CodePoint] = 0xFB1D
  489. OR ucd.[CodePoint] = 0xFB1E
  490. OR ucd.[CodePoint] BETWEEN 0xFB1F AND 0xFB28
  491. OR ucd.[CodePoint] BETWEEN 0xFB2A AND 0xFB36
  492. OR ucd.[CodePoint] BETWEEN 0xFB38 AND 0xFB3C
  493. OR ucd.[CodePoint] = 0xFB3E
  494. OR ucd.[CodePoint] BETWEEN 0xFB40 AND 0xFB41
  495. OR ucd.[CodePoint] BETWEEN 0xFB43 AND 0xFB44
  496. OR ucd.[CodePoint] BETWEEN 0xFB46 AND 0xFBB1
  497. OR ucd.[CodePoint] BETWEEN 0xFBD3 AND 0xFD3D
  498. OR ucd.[CodePoint] BETWEEN 0xFD50 AND 0xFD8F
  499. OR ucd.[CodePoint] BETWEEN 0xFD92 AND 0xFDC7
  500. OR ucd.[CodePoint] BETWEEN 0xFDF0 AND 0xFDFB
  501. OR ucd.[CodePoint] BETWEEN 0xFE70 AND 0xFE74
  502. OR ucd.[CodePoint] BETWEEN 0xFE76 AND 0xFEFC
  503. OR ucd.[CodePoint] BETWEEN 0xFF21 AND 0xFF3A
  504. OR ucd.[CodePoint] BETWEEN 0xFF41 AND 0xFF5A
  505. OR ucd.[CodePoint] BETWEEN 0xFF66 AND 0xFF6F
  506. OR ucd.[CodePoint] = 0xFF70
  507. OR ucd.[CodePoint] BETWEEN 0xFF71 AND 0xFF9D
  508. OR ucd.[CodePoint] BETWEEN 0xFF9E AND 0xFF9F
  509. OR ucd.[CodePoint] BETWEEN 0xFFA0 AND 0xFFBE
  510. OR ucd.[CodePoint] BETWEEN 0xFFC2 AND 0xFFC7
  511. OR ucd.[CodePoint] BETWEEN 0xFFCA AND 0xFFCF
  512. OR ucd.[CodePoint] BETWEEN 0xFFD2 AND 0xFFD7
  513. OR ucd.[CodePoint] BETWEEN 0xFFDA AND 0xFFDC
  514. ');
  515.  
  516.     -----------------------------------------------------------------------
  517.     -- Add and populate: "IsDecimal"
  518.     -----------------------------------
  519.  
  520. IF (NOT EXISTS(
  521.         SELECT *
  522.         FROM   sys.columns sc
  523.         WHERE  sc.[object_id] = OBJECT_ID(N'[v3-2].UnicodeCharacterDatabase')
  524.         AND    sc.[name] = N'IsDecimal'))
  525. BEGIN
  526.     ALTER TABLE [v3-2].UnicodeCharacterDatabase
  527.         ADD [IsDecimal] BIT NULL;
  528. END;
  529.  
  530. EXEC (N'
  531. UPDATE ucd
  532. SET    ucd.[IsDecimal] = 1
  533. -- SELECT *
  534. FROM   [v3-2].UnicodeCharacterDatabase ucd
  535. WHERE  ucd.[DecimalDigitValue] IS NOT NULL
  536. AND    ucd.[DigitValue] IS NOT NULL
  537. AND    ucd.[NumericValue] IS NOT NULL
  538. ');
  539.  
  540.     -----------------------------------------------------------------------
  541.  
  542.     COMMIT TRAN;
  543.  
  544. END TRY
  545. BEGIN CATCH
  546.     ROLLBACK TRAN;
  547.  
  548.     DECLARE @ErrorMessage NVARCHAR(4000);
  549.     SET @ErrorMessage = ERROR_MESSAGE();
  550.     RAISERROR(@ErrorMessage, 16, 1);
  551.     RETURN;
  552. END CATCH;
  553.  
  554.  
  555. EXEC (N'
  556. SELECT *
  557. FROM   [v3-2].UnicodeCharacterDatabase ucd
  558. WHERE  ucd.[IsAlphabetic] = 1
  559. OR     ucd.[IsDecimal] = 1;
  560. ');
  561. -- 46,268 rows
  562.  
  563.  
  564. GO
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top