Showing posts with label accidentaly. Show all posts
Showing posts with label accidentaly. Show all posts

Wednesday, March 21, 2012

Restoring rows accidentaly modified

Hello!
How can I Restore rows which are accidentaly modified.
I forgetted to put where condition in "Update" Query.
Now I want my data back. I have not taken back up manually yet.
I am using SQL Server 2000.
Please help.
Thank you,There is a way, but none via sql. As far as I know, you'rebasically SoL. Transactions can be rolled back, but you can't doit after it's already been commited. There's applications outthere that supposedly can do it, but I can't for the life of meremember the names of them.
Sorry man.
|||

Tsk tsk tsk ... let this be a lesson.
1) ***NEVER*** develop a DML script (UPD,INS,DEL) in production -- that's what a dev database is for
2) Backup your database every night or if possible, more often

|||

Alex Papadimoulis wrote:

Tsk tsk tsk ... let this be a lesson.


1) ***NEVER*** develop a DML script (UPD,INS,DEL) in production -- that's what a dev database is for


Well, I would assert that there are times where a DML script isneeded in production, and you don't have the luxury of using a devdatabase first. My suggestion is to ALWAYS wrap it in atransaction, with a ROLLBACK at the end, until you obtain the desiredresults.
BEGIN TRANSACTION
UPDATE
someTable
SET
someColumn = 'someValue'
WHERE
someCondition = 'True'
ROLLBACK -- change to COMMIT once you know you are updating the correct records
I ALWAYS ALWAYS ALWAYS do this, lesson learned the hard way.

Tuesday, March 20, 2012

Restoring Merge Repolication... HELP!

Hi,
I accidentaly remove a publication, I need to restore it!!!
What Date Base I must restore?
I Restore de Distribution database and only restore de Agents but not de
publication.
restore the publication database into another database with the
keep_replication switch. Then script it out and run it in the original
database.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Nicols Donoso" <Nicols Donoso @.discussions.microsoft.com> wrote in message
news:31ADDAF0-6E01-443A-891D-D33AB4EC1A67@.microsoft.com...
> Hi,
> I accidentaly remove a publication, I need to restore it!!!
> What Date Base I must restore?
> I Restore de Distribution database and only restore de Agents but not de
> publication.
>
>