Click here to Skip to main content
15,799,257 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
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.
Magic Wonder 18-Sep-14 7:37am    
I doubt, didn't you get error message like ...

String or binary data would be truncated.
The statement has been terminated.

while converting to char...
Sharma Richa 18-Sep-14 9:47am    
You can't get back this value as char takes only one char.
george4986 19-Sep-14 0:50am    
i haven't tried restoring yet.I hope these links will help u.

1 solution


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.

Share this answer
vanarajranjit 18-Sep-14 12:19pm    
Can you tell me how to do???
Magic Wonder 19-Sep-14 1:42am    
Check the link provided which will help you to understand, what is Transaction Log? But as i have already specified you can not get back those values. The only ray of hope is DBAs, if possible to them!!!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900