Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Help me buddy's... in sql server 2005 (topic:columns update)


Help me buddy's... in sql server 2005 (topic:columns update)

Author
Message
DivyaMohankumar
DivyaMohankumar
Grasshopper
Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)

Group: General Forum Members
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:
Discuss

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.Unsure
GilaMonster
GilaMonster
SSC-Forever
SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)

Group: General Forum Members
Points: 47295 Visits: 44392
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, MVP, M.Sc (Comp Sci)
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


DivyaMohankumar
DivyaMohankumar
Grasshopper
Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)

Group: General Forum Members
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
GilaMonster
GilaMonster
SSC-Forever
SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)

Group: General Forum Members
Points: 47295 Visits: 44392
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, MVP, M.Sc (Comp Sci)
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


DivyaMohankumar
DivyaMohankumar
Grasshopper
Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)

Group: General Forum Members
Points: 17 Visits: 14
thanks for your reply.. hehe:
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search