在sql中将varchar转换为数据类型int时出错 [英] error converting the varchar to datatype int in sql

查看:166
本文介绍了在sql中将varchar转换为数据类型int时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Quote:

创建表abc(一个varchar(100))

插入abc值('20 ')

之后我将Column改为int。在表中更改之后,该值仅为20。

再次将Column更改为char.note char,但我不像char(10)那样。在表中,值被更改为* .how我可以得到旧值20.请尽快回复我。

Create table abc (a varchar(100))
Insert into abc values ('20')
After that I altered the Column to int. After changing in table the value is 20 only.
Again altered the Column as char.note char only I put not like as char(10). In table the value is changed to *.how can I get the old value 20.please reply me ASAP.

推荐答案





由于未指定字符长度,您的数据被截断。我想你无法取回那些价值观。我不确定,您可以使用DBA签入事务日志。



查看此交易日志 [ ^ ]





希望这会对你有所帮助。



干杯
Hi,

Your data got truncated as you did not specified the char length. I think you can not get back those values. I am not sure, may be you can check in transaction logs with DBA.

Check this Transaction Logs[^]


Hope this will help you.

Cheers


这篇关于在sql中将varchar转换为数据类型int时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆