July 17, 2009 at 1:47 pm
I copied a bunch of data over today, and didn't realize that the people who worked here before had created a table with no restraints against duplicate rows. I backed up the database a few days ago, and would like to restore just the one table. One solution I thought of would be to restore it to a temp database, then copy that one table over. Is this the best way?
If so, how to you do a restore to a different or temp database?
July 17, 2009 at 2:29 pm
Yes the restore to a new or temporary database is the way to do this.
The syntax for restoring a backup to a different database is this:
RESTORE newDatabase FROM DISK='Path to Backup file'
WITH MOVE 'DataFileLogicalName' TO 'Path to new mdf File',
MOVE 'LogFileLogicalName' TO 'Path to new ldf file'
You can get the Logical File Name by running
Restore FileListOnly From Disk='Path to backup file'
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
July 17, 2009 at 2:38 pm
thanks!
I am learning so much here it's scary.
January 25, 2010 at 6:31 pm
MS SQL doesnt have option to restore a table from the backup file, but third party tools are supporting this feature. If you are using Quest LiteSpeed then you can do the Object level recovery. See more details on this link http://www.sqldbops.com/2010/01/on-ms-sql-how-to-restore-table-or.html
thanks
Jay
Thanks
Jay
http://www.sqldbops.com
January 26, 2010 at 7:51 am
middletree (7/17/2009)
thanks!I am learning so much here it's scary.
Don't be afraid to ask questions. I learn something new everyday on this site.
January 26, 2010 at 7:59 am
RedGate now offers a tool for object level recovery SQL Object Level Recovery Native that will recover an object from a native sql server backup.
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
January 26, 2010 at 11:21 am
This is good information from Jack and Jayakumar.
Without the tools mentioned by Jack and Jayakumar, you would only be able to restore the table as described in Jack's first post.
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply