November 21, 2008 at 7:32 am
There was an update statement run on our report table, which updated all the records instead of one. The sad part is that the changes were committed. Its a SQL 2000 on Sp4 database. Backup is with Litespeed. Should I use object recovery feature of Litespeed to restore the table or should I create a new database, restore it to a point in time and just copy that table..Also, can I just copy the singe column?? if so how? please advise
Thanks!!
The_SQL_DBA
MCTS
"Quality is never an accident; it is always the result of high intention, sincere effort, intelligent direction and skillful execution; it represents the wise choice of many alternatives."
November 21, 2008 at 8:47 am
I've never used litespeed, but if you restore to a new DB you can just run an update statement across DB's using the PK's to update the single column.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
November 21, 2008 at 8:55 am
how would an update be on the PK column? Will my life be easier if I use DTS and copy the table, the data in it is static so we'll be fine with the changes from the last backup..thanks!!
The_SQL_DBA
MCTS
"Quality is never an accident; it is always the result of high intention, sincere effort, intelligent direction and skillful execution; it represents the wise choice of many alternatives."
November 21, 2008 at 9:05 am
The_SQL_DBA (11/21/2008)
how would an update be on the PK column? Will my life be easier if I use DTS and copy the table, the data in it is static so we'll be fine with the changes from the last backup..thanks!!
I meant using the PK as a join. Like:
Update T
Set Column = T2.column
From
db1.dbo.table T Join
db2.dbo.table T2 On
T.pk = T2.pk
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
November 21, 2008 at 9:24 am
I ran this replacing the table and db names with the ones i have on the destination database. It says 20 rows affected but does not reflect those changes on the table? Am I missing something? Thanks!!
The_SQL_DBA
MCTS
"Quality is never an accident; it is always the result of high intention, sincere effort, intelligent direction and skillful execution; it represents the wise choice of many alternatives."
November 21, 2008 at 9:28 am
The update I ran is this:
Update dbo.ReportblCust
Set ValidMsgDisp = ReportblCust.ValidMsgDisp
From
ReportData_DPS.dbo.ReportblCust Join
ReportData_DPSTest.dbo.ReportblCust On
ReportblCust.RptID =ReportblCust.RptID
RptID is the primary key on both..
Thanks!!
The_SQL_DBA
MCTS
"Quality is never an accident; it is always the result of high intention, sincere effort, intelligent direction and skillful execution; it represents the wise choice of many alternatives."
November 21, 2008 at 11:50 am
Are you sure the point you restored to was BEFORE the update?
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
November 21, 2008 at 1:15 pm
Yes, I restore to a point in time before the update..Thanks!!
The_SQL_DBA
MCTS
"Quality is never an accident; it is always the result of high intention, sincere effort, intelligent direction and skillful execution; it represents the wise choice of many alternatives."
November 21, 2008 at 4:59 pm
Run this:
Update dbo.ReportblCust
Set ValidMsgDisp = Source.ValidMsgDisp
From
ReportData_DPS.dbo.ReportblCust Dest Join
ReportData_DPSTest.dbo.ReportblCust Source On
Source.RptID =Dest.RptID
Source: Restored database
Dest: Current database
HTH!
MJ
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply