Restore a single table in MS SQL 2005

Go down



Restore a single table in MS SQL 2005

For my work I had to restore one table from a backup. Now SQL doesn't have this function anymore since version 6.5 or so. But what if you can't restore the full database for whatever reason. Well here is how I did it, might not be the best solution, but it worked for me.

First I took the latest complete backup and restored it into a temporary directory, this way the whole database is restored including the table you need. Now first check if the table is indeed the one you need and all data is available, would be a shame to do it for nothing.

Next rename or delete the old table, just to be sure.

Next we start a new query and fill in SELECT * INTO OriginalDB.dbo.Table FROM RestoredDB.dbo.Table and run the query. In my case it was the following.

Now all data and the schema has been copied, however you still miss indexes, foreign keys, statistics etc. More on this later.

Posts : 2238
Join date : 2009-08-18
Age : 36
Location : Zoetermeer

View user profile

Back to top Go down

- Similar topics
Share this post on: diggdeliciousredditstumbleuponslashdotyahoogooglelive

Permissions in this forum:
You cannot reply to topics in this forum