SQL 行只有 varchar(10) 但有 30+里面的人物
外部数据库上的表(当我单击“修改”时)指出 A 行是 varchar(10),但当我查看数据时,其中显然有更多字符。这怎么可能?
这让我很担心,因为当我从该行提取数据时,我只得到 10 个字符,其余的都被截断了。我不允许修改外部数据库表。
table on external database (when I click modify) states that row A is a varchar(10) but when I look at the data there is obviously many more characters in it. How is this possible?
This concerns me because when I pull data from that row, I only get 10 characters, and the rest is cut off. I am not allowed to modify the external database tables.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这怎么可能?
该列最初可能是 varchar(30),随后更改为 varchar(10)。我假设自从更改为 varchar(10) 以来数据已被写入,这使得情况变得一团糟。如果无法将列的长度改回 30,我将研究将旧数据截断为 10 个字符的影响。
更新
运行以下语句来确认列长度:
更新 2:
How is this possible?
The column was probably originally a varchar(30) and was subsequently altered to varchar(10). I assume data has been written since the change to varchar(10), which makes this a true mess. If altering the column back to a length of 30 is not possible, I would investigate the implications of truncating the old data to 10 characters.
Update
run the following statement to confirm the column length:
Update 2:
它可以是一个 varchar10 (x30) 列,具有“的幂”修饰符。
It could be a varchar10 (x30) column, having a "to the power of" modifier.