Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2010
    Posts
    2

    Unanswered: Backup Database except one table

    I'm working with SQL Server 2005.
    I would like to backup the entaire database but without one table.
    Is there a command line for this option?

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    ONly if you used filegroups. Have you used file groups?
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    If you want to retain the secrecy of the contents of just 1 table, but have relatively small number of tables and rows in them (alltogether somewhere under 1GB), then you can trnasfer the database and pick all but 1 table. You can also restore an existing backup to a new database, drop constraints that point to your secret table, then drop that table, and make a backup of this database. you can also extract the data from your secret table, including the primary key, then scramble all columns (including just setting them all to null) except for the primary key, backup the database, then import previously exported data into a new table, issue an update against the old table relying on primary key, and then drop the new table. What else...Why do you need it?
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

  4. #4
    Join Date
    Jul 2010
    Posts
    2
    Thanks for your answers.

    I'm not working with filegroups...
    I have an existing database that I would like to backup that contains only tables and views. This DB has one big table of logs that I don't need to backup but I can delete it either.
    I can't copy the entire DB and then delete the table since I don't have enough space.
    In MySql I have an option to backup with "--ingore-table=[tablename]". Isn't there parallel option in MsSql?
    In case there isn't any better solution - can I query for all tables' names and then backup the DB by this list (except for the logs table of course...)?

  5. #5
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    No, you cannot ignore the table.
    There is a solution: look at file groups in Books Online. You can create a filegroup, move the table to that. Backing up the original filegroup will do what you want - a database backup minus your log table.
    Testimonial:
    pootle flump
    ur codings are working excelent.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •