版本:SQL Server 2016
--創建資料庫(欄位大小為3)
CREATE TABLE [dbo].[test] ([a] nvarchar(3))
--插入長度超過3的字串,報錯。
INSERT INTO test VALUES('1111111111');
--[Err] 22001 - [SQL Server]String or binary data would be truncated.
--插入長度超過3的字串 (成功插入,沒報錯!!!)
INSERT INTO test VALUES('1 ');
--查看資料庫該記錄是'1 ',發現長度超過3的空格被截斷了。
有人知道這是什么機制?翻了官方檔案沒找到。
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/247873.html
標籤:疑難問題
上一篇:hive庫缺少值
