Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Help me buddy's... in sql server 2005 (topic:columns update) Expand / Collapse
Author
Message
Posted Thursday, July 11, 2013 6:05 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Wednesday, July 31, 2013 3:12 AM
Points: 17, Visits: 14
Hi everyone,
I would appreciate if anyone help me in this topic.In brief i will describe about my work done;

1) I have CREATED TABLE call it as CUSTOMER with columns(id,name,age,address,salary).
2) I have inserted 3Rows in this table as below:


ID NAME AGE ADDRESS SALARY
1 AA 12 CHENNAI 2000.00
2 BB 18 BOMBAY 18,000.00
3 CC 22 DELHI 25,000.00

3) i have now UPDATED THIS TABLE with the below query
UPDATE CUSTOMER SET SALARY = 5000.00

4) The COLUMN SALARY got updated by default value 5000.00. Now table looks like below:
ID NAME AGE ADDRESS SALARY
1 AA 12 CHENNAI 5000.00
2 BB 18 BOMBAY 5000.00
3 CC 22 DELHI 5000.00

5) Now my question is how can i get the old values in the table , as i inserted.

we can use WHERE CONDITION WHILE UPDATING A COLUMN BUT UNFORTUNATELY I UPDATED NOW I WANT TO BRING IT BACK AS I INSERTED PLEASE ANYONE HELP ME.



Post #1472528
Posted Thursday, July 11, 2013 6:13 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Yesterday @ 4:08 PM
Points: 40,177, Visits: 36,580
DivyaMohankumar (7/11/2013)
5) Now my question is how can i get the old values in the table , as i inserted.


Get a backup that was taken before the update was done, restore it as a new database, copy the overwritten data out.



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1472532
Posted Thursday, July 11, 2013 6:22 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Wednesday, July 31, 2013 3:12 AM
Points: 17, Visits: 14
Hi Gail
Thanks for your reply...
And i am sorry for , i did not take a back up for it . . . So i am unable to do that
Post #1472540
Posted Thursday, July 11, 2013 6:25 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Yesterday @ 4:08 PM
Points: 40,177, Visits: 36,580
If you don't have a backup then you cannot get the old values back. Unless you did the update in an explicit transaction and that transaction has not yet been committed


Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1472543
Posted Thursday, July 11, 2013 6:41 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Wednesday, July 31, 2013 3:12 AM
Points: 17, Visits: 14
thanks for your reply.. hehe:
Post #1472549
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse