Advertisement
SqlQuantumLeap

UTF8_Bug_35606671_SQLCMD-Tests

Oct 15th, 2018
355
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.55 KB | None | 0 0
  1. -- These examples support the following bug report for SQL Server 2019 CTP 2.0:
  2. -- https://feedback.azure.com/forums/908035-sql-server/suggestions/35606671-utf-8-in-sql-2019-an-error-occurred-while-executi
  3.  
  4. -- By: Solomon Rutzky
  5. -- On: 2018-10-15
  6. -- https://SqlQuantumLeap.com/
  7.  
  8. -----------------------------------------------------------------------
  9. IF (DB_ID(N'UTF8') IS NULL)
  10. BEGIN
  11. CREATE DATABASE [UTF8] COLLATE Latin1_General_100_CI_AS_SC_UTF8;
  12. ALTER DATABASE [UTF8] SET RECOVERY SIMPLE;
  13. END;
  14. GO
  15. -----------------------------------------------------------------------
  16.  
  17.  
  18.  
  19.  
  20. CD /D C:\Program Files\Microsoft SQL Server\110\Tools\Binn
  21. .\SQLCMD.EXE /?
  22. Microsoft (R) SQL Server Command Line Tool
  23. Version 11.0.2100.60 NT x64
  24. Copyright (c) 2012 Microsoft. All rights reserved.
  25.  
  26.  
  27. .\SQLCMD -S (local)\SQL2019 -Uz -Pz
  28. Sqlcmd: Error: Microsoft SQL Server Native Client 11.0 : Login failed for user 'z'..
  29.  
  30.  
  31. .\SQLCMD -S (local)\SQL2019 -d UTF8 -Q "SELECT TOP (100) CONVERT(BIT, 1) AS [1], CONVERT(BIT, 1) AS [2], CONVERT(BIT, 1) AS [3], CONVERT(BIT, 1) AS [4], CONVERT(CHAR(1), NULL) AS [NULL], CONVERT(BIT, 1) AS [5], NCHAR(50505) + NCHAR(20202) + N'gf' + NCHAR(10101) + NCHAR(66666) AS [6], 'abcdefghijklmnoptuvwxyz' AS [7], CONVERT(BIGINT, 1) AS [8] FROM [master].[sys].[columns] col ;"
  32. 1 2 3 4 NULL 5 6 7 8
  33. - - - - ---- - ---------- ----------------------- --------------------
  34. 1 1 1 1
  35.  
  36.  
  37.  
  38. ------------------------------------
  39.  
  40.  
  41.  
  42. CD /D C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn
  43. .\SQLCMD.EXE /?
  44. Microsoft (R) SQL Server Command Line Tool
  45. Version 14.0.3037.1 NT
  46. Copyright (C) 2017 Microsoft Corporation. All rights reserved.
  47.  
  48.  
  49. .\SQLCMD -S (local)\SQL2019 -Uz -Pz
  50. Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : Login failed for user 'z'..
  51.  
  52.  
  53. .\SQLCMD -S (local)\SQL2019 -d UTF8 -Q "SELECT TOP (100) CONVERT(BIT, 1) AS [1], CONVERT(BIT, 1) AS [2], CONVERT(BIT, 1) AS [3], CONVERT(BIT, 1) AS [4], CONVERT(CHAR(1), NULL) AS [NULL], CONVERT(BIT, 1) AS [5], NCHAR(50505) + NCHAR(20202) + N'gf' + NCHAR(10101) + NCHAR(66666) AS [6], 'abcdefghijklmnoptuvwxyz' AS [7], CONVERT(BIGINT, 1) AS [8] FROM [master].[sys].[columns] col ;"
  54. 1 2 3 4 NULL 5 6 7 8
  55. - - - - ---- - ---------- ----------------------- --------------------
  56. 1 1 1 1 Sqlcmd: Error: Internal error at ReadAndHandleColumnData (Reason: Error reading column data).
  57.  
  58.  
  59.  
  60. ------------------------------------
  61.  
  62.  
  63.  
  64. CD /D C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn
  65. .\SQLCMD.EXE /?
  66. Microsoft (R) SQL Server Command Line Tool
  67. Version 15.0.1000.34 NT
  68. Copyright (C) 2018 Microsoft Corporation. All rights reserved.
  69.  
  70.  
  71. .\SQLCMD -S (local)\SQL2019 -Uz -Pz
  72. Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Login failed for user 'z'..
  73.  
  74.  
  75. .\SQLCMD -S (local)\SQL2019 -d UTF8 -Q "SELECT TOP (100) CONVERT(BIT, 1) AS [1], CONVERT(BIT, 1) AS [2], CONVERT(BIT, 1) AS [3], CONVERT(BIT, 1) AS [4], CONVERT(CHAR(1), NULL) AS [NULL], CONVERT(BIT, 1) AS [5], NCHAR(50505) + NCHAR(20202) + N'gf' + NCHAR(10101) + NCHAR(66666) AS [6], 'abcdefghijklmnoptuvwxyz' AS [7], CONVERT(BIGINT, 1) AS [8] FROM [master].[sys].[columns] col ;"
  76. 1 2 3 4 NULL 5 6 7 8
  77. - - - - ---- - ---------- ----------------------- --------------------
  78. 1 1 1 1 NULL 1 ??gf??? abcdefghijklmnoptuvwxyz 1
  79. ...
  80. 1 1 1 1 NULL 1 ??gf??? abcdefghijklmnoptuvwxyz 1
  81.  
  82. (100 rows affected)
  83.  
  84.  
  85. -----------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement