Click here to Skip to main content
15,892,537 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
Quote:
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.
Posted
Comments
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.
http://www.mssqltips.com/sqlservertip/3160/recover-deleted-sql-server-data-and-tables-with-the-help-of-transaction-log-and-lsns/

http://www.techrepublic.com/blog/the-enterprise-cloud/restore-your-sql-server-database-using-transaction-logs/

1 solution

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
 
Share this answer
 
v2
Comments
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