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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 undo update

Author  Topic 

a.ashabi
Posting Yak Master

117 Posts

Posted - 2009-04-13 : 05:34:11
plz help me.I forgot to put where on my update :(
I have no backup for it.
if there is a way to "undo" the last change to the database or undo the update plz help me with that.
thanks

PS:Im working with sql 2005

karthik_padbanaban
Constraint Violating Yak Guru

263 Posts

Posted - 2009-04-13 : 05:47:48
Oh I think you cant undo that, Try to restore the backup if you have.

But some third party tools are avialable.

(But I never used)
www.lumigent.com and
www.logpi.com

Karthik
Go to Top of Page

a.ashabi
Posting Yak Master

117 Posts

Posted - 2009-04-13 : 05:58:59
I have found the a mdf file from it can I use it for restore?
Go to Top of Page

ashishashish
Constraint Violating Yak Guru

408 Posts

Posted - 2009-04-13 : 05:59:14
yes karthik is right.........
i also think that you are not able to undo that??
i also dont know any third party tool... which works without backups...
so thats why backups are important??
Well may be someone else here knows much about this,,,,
i also post that as many as places i can so if there any help available..
thanks...
Go to Top of Page

ashishashish
Constraint Violating Yak Guru

408 Posts

Posted - 2009-04-13 : 05:59:56
yes,,,, u can attach the databse again
if you find mdf(old) file....
Go to Top of Page

a.ashabi
Posting Yak Master

117 Posts

Posted - 2009-04-13 : 06:10:39
thanks for yr reply,but I when I right clk on my Db there is only detach option instead of attach!! should I detach first & then attach?
I also use this:

sp_attach_single_file_db @dbname= 'fakhimi', @physname= 'E:\sqldata\fakhimi_Data.MDF'

but I got this error:
Msg 1801, Level 16, State 3, Line 1
Database 'fakhimi' already exists.

what should I do?
Go to Top of Page

ashishashish
Constraint Violating Yak Guru

408 Posts

Posted - 2009-04-13 : 06:20:08
Open server management studio....
then expand where your server name is showing..
there you will see databases,Security,Server Objects and more,,
so right click on databases here u find attach..

or

EXEC sp_attach_single_file_db @dbname = 'pubs',
@physname = 'c:\Program Files\Microsoft SQL Server\MSSQL\Data\pubs_Data.MDF'

or


USE master;
GO
CREATE DATABASE MyAdventureWorks
ON (FILENAME = 'C:\MySQLServer\AdventureWorks_Data.mdf'),
(FILENAME = 'C:\MySQLServer\AdventureWorks_Log.ldf')
FOR ATTACH;
GO


Thanks..
Go to Top of Page

a.ashabi
Posting Yak Master

117 Posts

Posted - 2009-04-13 : 06:34:22
thank u so much :)
Go to Top of Page

ashishashish
Constraint Violating Yak Guru

408 Posts

Posted - 2009-04-13 : 07:41:04
Always Welcome..........
well this is the firs time when i receive thanks from anybosy,,,,
ha ha
Go to Top of Page
   

- Advertisement -