Restoring Just 1 Table from a .BAK file

Hey,

I have a MS SQL 2005 database, however one of the tables has old data in it which I want replaced.

I have a .BAK file that was created a week ago, which has the correct data in this particular table, and I want the data from this table in the BAK file to replace the same table in the current database.

I cant just do a full table because there is other information in other tables in the BAK file which is old.

How can I do this? I am thinking if I could just export then import the data from this table, but dont know how to do this. I am used to MYSQL, and know this can be done easily using phpmyadmin.

Any help would be great.

What you want to do is restore that backup to a separate database, then you can use Sql Server Management Studio to “import” the data and wipe out the other table.

Note that if there are foreign keys referencing things, then it could get dicey. Backup everything before beginning.

thanks for the reply.

OK so I have loaded the BAK file into a seperate database, but am unsure how to go on from there.

In visual studio express when I right click on the table i can see some options but nothing that allows my to update the table.

I went into the old database that I just loaded from the BAK file, right clicked on the table I want to copy, clicked open, and then selected all and press copied, but then when I logged out and into the correct database and tried to do the same but paste the data over the top it would let me. I think down the bottom it was saying read only.

Can anyone give me some steps to follow? Thanks.

Do you have Sql Server Management Studio? That will work alot better. What you want to do is use the import data option then follow the prompts, making sure to go advanced and choose the “overwrite data” option.

Now, this still may not work as there might be constraints and such involved. We don’t know enough about the specific database to tackle that one.