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 |
|
kid_on_the_block
Posting Yak Master
172 Posts |
Posted - 2006-04-19 : 01:00:33
|
| By Database is heavily used , we use Transaction log backups ever 10 minuts, now someone fired a wrong query , that updated a particular table , the DB is still in use, there are some users working on it , I cant get the DB offline , what can I do to correct the mistake , please advice. |
|
|
Kristen
Test
22859 Posts |
Posted - 2006-04-19 : 01:09:55
|
Restore to point-in-time [just before the accident] to a DIFFERENT, NEW, (temporary) DATABASE. Then update the original database data by joining it to the same table in the new database.Your UPDATE will have to be selective to only update what was broken, and not what might have been changed subsequently.Something like this:UPDATE USET TheDamagedColumn = S.TheDamagedColumnFROM MyLiveDatabase.dbo.MyTable AS U JOIN MyTEMPDatabase.dbo.MyTable AS S ON S.MyPK = U.MyPKWHERE ... criteria for what is a damaged record! ... Kristen |
 |
|
|
Merkin
Funky Drop Bear Fearing SQL Dude!
4970 Posts |
Posted - 2006-04-19 : 01:22:32
|
Damn, I read that as "wrong query, fired" Damian"A foolish consistency is the hobgoblin of little minds." - Emerson |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2006-04-19 : 02:13:24
|
|
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-04-19 : 02:15:33
|
I guess somebody that fired the wrong query will be fired  KH |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-04-19 : 02:23:01
|
| If some records are deleted then you may need to insert them from backup tableMadhivananFailing to plan is Planning to fail |
 |
|
|
Merkin
Funky Drop Bear Fearing SQL Dude!
4970 Posts |
Posted - 2006-04-19 : 02:27:09
|
quote: Originally posted by madhivanan If some records are deleted then you may need to insert them from backup tableMadhivananFailing to plan is Planning to fail
Genius! Damian"A foolish consistency is the hobgoblin of little minds." - Emerson |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-04-19 : 02:32:47
|
quote: Originally posted by Merkin
quote: Originally posted by madhivanan If some records are deleted then you may need to insert them from backup tableMadhivananFailing to plan is Planning to fail
Genius! Damian"A foolish consistency is the hobgoblin of little minds." - Emerson
Thanks. I am happy to get appreciation from you MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|
|
|