Tuesday, February 21, 2012

Restore / Backup - NEED HELP ASAP

Hi there,
I have a big favour to ask you.
I accidently delete one of my table in database. However, luckly I
have a bak file.
But, I can't restore whole database with bak file because since I
deleted table, there are new data in that table and other table as
well.
Is there any way I can only restore/update my database with bak file?
I know that there is no way to restore only one table. So, I am
looking for anther way to restore database.
Need your help as soon as possible.
Thanks
You can restore the backup to a different database name and different file
names and then recover the missing data. For example:
RESTORE DATABASE MyDatabase_Temp
FROM DISK='C:\Backups\MyDatabase.bak'
WITH
MOVE 'MyDatabase' TO 'D:\DataFiles\MyDatabase_Temp.mdf',
MOVE 'MyDatabase_Log' TO 'E:\LogFiles\MyDatabase_Temp_Log.ldf',
STATS=5
Also, you can list the logical file names needed for the MOVE option with
RESTORE FILELISTONLY:
RESTORE FILELISTONLY
FROM DISK='C:\Backups\MyDatabase.bak'
Hope this helps.
Dan Guzman
SQL Server MVP
"portCo" <woosubc@.gmail.com> wrote in message
news:1174448208.379362.17330@.l77g2000hsb.googlegro ups.com...
> Hi there,
> I have a big favour to ask you.
> I accidently delete one of my table in database. However, luckly I
> have a bak file.
> But, I can't restore whole database with bak file because since I
> deleted table, there are new data in that table and other table as
> well.
> Is there any way I can only restore/update my database with bak file?
> I know that there is no way to restore only one table. So, I am
> looking for anther way to restore database.
>
> Need your help as soon as possible.
>
> Thanks
>
|||Thanks for your help. It really helped.
I actually restore to different name. However, I am having problem
with recovering missing data.
For example,
Schema is like (userID, userName, Phone)
table1 (1, A, 1111111111)
(2, B, 2222222222)
total: 2 rows.
table2 (2, B, 4444444444)
(3, C, 3333333333)
total: 2 rows.
So, here is a situation. I want to use table2 to update (if userID
exists) and insert (if userID not exists) of table 1.
I am trying to figure it out what I have to do for hours. But no luck
so far,
If anyone can help me out this, I will appreciated it.
Thanks alot,
On Mar 20, 8:52 pm, "Dan Guzman" <guzma...@.nospam-
online.sbcglobal.net> wrote:
> You can restore the backup to a different database name and different file
> names and then recover the missing data. For example:
> RESTORE DATABASE MyDatabase_Temp
> FROM DISK='C:\Backups\MyDatabase.bak'
> WITH
> MOVE 'MyDatabase' TO 'D:\DataFiles\MyDatabase_Temp.mdf',
> MOVE 'MyDatabase_Log' TO 'E:\LogFiles\MyDatabase_Temp_Log.ldf',
> STATS=5
> Also, you can list the logical file names needed for the MOVE option with
> RESTORE FILELISTONLY:
> RESTORE FILELISTONLY
> FROM DISK='C:\Backups\MyDatabase.bak'
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "portCo" <woos...@.gmail.com> wrote in message
> news:1174448208.379362.17330@.l77g2000hsb.googlegro ups.com...
>
>
>
>
> - Show quoted text -
|||Oops, I got it to work.
Thanks
On Mar 20, 10:38 pm, "portCo" <woos...@.gmail.com> wrote:
> Thanks for your help. It really helped.
> I actually restore to different name. However, I am having problem
> with recovering missing data.
> For example,
> Schema is like (userID, userName, Phone)
> table1 (1, A, 1111111111)
> (2, B, 2222222222)
> total: 2 rows.
> table2 (2, B, 4444444444)
> (3, C, 3333333333)
> total: 2 rows.
> So, here is a situation. I want to use table2 to update (if userID
> exists) and insert (if userID not exists) of table 1.
> I am trying to figure it out what I have to do for hours. But no luck
> so far,
> If anyone can help me out this, I will appreciated it.
> Thanks alot,
> On Mar 20, 8:52 pm, "Dan Guzman" <guzma...@.nospam-
>
> online.sbcglobal.net> wrote:
>
>
>
>
>
>
>
> - Show quoted text -
|||I'm glad you were able to sort things out.
Hope this helps.
Dan Guzman
SQL Server MVP
"portCo" <woosubc@.gmail.com> wrote in message
news:1174458361.130223.256700@.e65g2000hsc.googlegr oups.com...
> Oops, I got it to work.
> Thanks
>
> On Mar 20, 10:38 pm, "portCo" <woos...@.gmail.com> wrote:
>

No comments:

Post a Comment