在sql中将varchar转换为数据类型int时出错

在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