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 |
|
sqlteambridge
Starting Member
5 Posts |
Posted - 2004-09-10 : 16:06:14
|
| Tara, (Experience does not have _Data attached)>Read alot of threads from you and would like to post another...A client >deleted all records inside a table. I would like to restore the table >only to a different database. I am using query analyzer directly from >the SQL server.>>Old database is called: Experience>New database is called: Bvanarsdale>>I am trying to restore a sql .bak file to a different database and the >result is the following:>Command:>Restore database Experience>from disk = 'c:\bvanarsdale\programfiles\ Microsoft SQL >Server\MSSQL\Backup\Experience\Experience_db_200409092100.bakl>with replace, move 'Experience' to 'c:\program files\Microsoft SQL >Server\MSSQL\Data\Bvanarsdale_Data.mdf',move 'Experience_Log' to ''c:\program files\Microsoft SQL >Server\MSSQL\Data\Bvanarsdale_Log.LDF' stats>>>Result:>>Server MSg 3234, Level 16, State 2, Line 1 Logical file 'Experience' is >not part of the database 'Experience'. Use Restore FILELISTONLY>>>Any help would be greatly appreciated. |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2004-09-10 : 16:35:44
|
| Run this:Restore FILELISTONLYFROM DISK = '<path and filename go here>'Your WITH MOVE will need to reflect the output of the above. You can post the output here if you need help with it. You also should have RESTORE Bvanarsdale instead of RESTORE Experience as what you have will overwrite your current one.Tara |
 |
|
|
sqlteambridge
Starting Member
5 Posts |
Posted - 2004-09-13 : 08:13:25
|
| Tara,I executed your post by typing restore filelistonly and it worked. But here is my scenario. The command put the files back into the original c:\MSSQL\data\.. directory. I need the files to be restored into a seperate database called bvanarsdale...the original database is called experience. The restore is occuring because one table within experience got deleted but the other tables are fine. I would like to restore the database into a seperate database then view the deleted table and restore that table only. Is that possible? |
 |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2004-09-13 : 08:21:01
|
| Here's a little more detail of Tara's example:RESTORE DATABASE bvanarsdale FROM DISK='backup file path' WITH MOVE 'logical data file' TO 'C:\MSSQL\data\bvanarsdale_data.mdf',MOVE 'logical log file' TO 'C:\MSSQL\data\bvanarsdale_log.mdf'Just replace all of the file names and paths to match the ones you want to use. The logical file names must be the same as what RESTORE FILELISTONLY shows, but the physical file names and paths can be changed. You can even restore to a completely different drive if you want to. |
 |
|
|
sqlteambridge
Starting Member
5 Posts |
Posted - 2004-09-13 : 09:06:23
|
| I executed the command as stated and this was the output.Server: MSG 3141, Level 16, State 1, Line 1The database to be restored was named 'Experience'.Reissue the statement using the WITH REPLACE option to overwritethe 'bvanarsdale' database. Restore database is terminating abnormally.I then tried the WITH REPLACE option and this was the output.'REPLACE' is not a recognized RESTORE option. |
 |
|
|
sqlteambridge
Starting Member
5 Posts |
Posted - 2004-09-13 : 09:14:24
|
| I used the REPLACE, MOVE option and it restored fine. But I have one other question to finish this thread. Now I have two differently named databases with identical tables. Is it possible to copy one table from one database to the other database table? Can it be done with a query statement ... |
 |
|
|
sqlteambridge
Starting Member
5 Posts |
Posted - 2004-09-13 : 09:40:54
|
| I wrote a query to transfer the information from one table to the other. Everything is fine.Thanks a bunch....this is a great site. |
 |
|
|
|
|
|
|
|