How to backup tables only?

  • Hi everyone, I need to backup all tables in a database. Is it possible to only backup the tables?

    If I backup the data file(group) and restore it to another database, would that restore the tables along with the data? Are there any other "side-effects" to this approach? Thank you.

  • When you backup a database it backs up everything (Tables (schema and data), views, stored procedures, users, etc).

    If you restore a backup onto another database it will restore everything (tables, views, stored prodedures, users, etc).

    Side effects, are when you restore a database on to another server you will most like end up with orphan users.

    Gregory Larsen, DBA

    If you looking for SQL Server Examples check out my website at http://www.geocities.com/sqlserverexamples

    Gregory A. Larsen, MVP

  • But I don't want to back up everything. I only want the tables.

    I have another question, if I back up everything (full backup) and restore to another database, will the restore remove the tables that are already in the new database? For example, if the new database has table A and the restore is going to restore table b and some procedures, will table A still be in that database after the restore is finished?

    Thanks.

  • If you want to backup only tables, then create the tables on a Filegroup. Then backup the Filegroup.

    - good for a large size table.

    If want just the table schema then script it out.

    Could also use DTS here depending on exactly what you want to accomplish.

  • If you restore a database it will overlay everything in an existing database. In your example table A will be gone.

    If all you really want to do is migrate tables, maybe DTS is really the tools you should use.

    Gregory Larsen, DBA

    If you looking for SQL Server Examples check out my website at http://www.geocities.com/sqlserverexamples

    Gregory A. Larsen, MVP

  • If you restore over an existing database, what will remain is exactly whats in the backup you are using.

    Everything will be overwritten.

  • Use DTS. This is easiest with the export or import function on the right-shift menu.

    It has enough options for most purposes.

  • Hi ,

    You were able to backup the tables only in SQl server 6.5 version.But after 6.5 version you cann't backup only the tables.If you want to do that as meantioned by some one you have to keep all the tables on a different filegroup and do a file group backup.

  • Thank you for your help everyone.

    I have one more question. Lets say I have all of my tables on one filegroup and I back that filegroup and restore it to another database. Will I loose any of the views and scripts on that database or will the restore only replace the tables in that database?

    Thanks again.

Viewing 9 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply