Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
ersantosh1
Starting Member
6 Posts |
Posted - 2013-01-19 : 08:38:38
|
Hi,I'm having a table Employee. by mistake because of update script i haveupdated column Emp_account_no of 8 employee. I want to restore previous account no of those 8 employee.Rollback wont work.So i want to write simple procedure which will restore my previous acc no.Table name: EmployeeDB name: CompanyModified column name Emp_acc_noPrimary key: Emp_id I'm using sql server 2000Please can any one help me i'm in big trouble.Thanks and regardssantoshsrahangdale |
|
James K
Master Smack Fu Yak Hacker
3873 Posts |
Posted - 2013-01-19 : 12:03:06
|
If you know the Emp_Id's of the employees whose Emp_Acc_no need to be reverted, then you can do the following:UPDATE Employee SET Emp_acc_no = 'CorrectAcctountNumber' WHERE Emp_id = 12345; Since there are only eight rows, I would do them one by one carefully. Be very very careful to include the where clause, or you will destroy the account numbers of all employees! Test it in a dev server to make sure you are doing the right thing. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-01-19 : 13:29:30
|
is there a logic to identify those 8 records? or do you know their ids?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
|
|
|