What I Did After Updating Database by Mistake?
So sorry that I falsely updated the database with the following script:
update dbo.country
set country = 'Australia'
-- where countryID = 'AU'
I didn’t select the last line, so all the original data under country column is lost and cannot be rollback. I write this blog to record what I’ve after that:
- Call DBA, ask for a backup instance
- Call manager, report the mistake
- Migrate the data back from the backup instance to production
- Write an Email to tell manager all done
What I learnt:
UPDATE dbo.count
UPDATE dbo.count WHERE countryID = 'AU'
UPDATE dbo.count SET country = 'Australia' WHERE countryID = 'AU'
UPDATE dbo.count SET country = 'Australia' WHERE countryID = 'AU'; -- add ;