tmoney101 — 2008-04-16T01:43:48-04:00 — #1
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.
wwb_99 — 2008-04-16T06:53:20-04:00 — #2
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.
tmoney101 — 2008-04-16T09:45:47-04:00 — #3
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.
wwb_99 — 2008-04-16T11:00:45-04:00 — #4
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.
mittineague — 2014-09-24T00:31:32-04:00 — #5
This topic is now archived. It is frozen and cannot be changed in any way.