Backup SQL table along with Partitions

Rathirojini Sangilipandy 241 Reputation points
2021-11-08T08:54:41.523+00:00

HI ,

I need to backup SQL table from One DB to another along with the partition. Here are some info

1) Table size is very big each partition has more than 5m rows and there are almost 30 partitions.
2) Table need to be backup along with the partition
3) SQL server Management studio 18 version will be used .
4) can this backup be treated as normal backup or since the partition is enabled some things need to be consider?

Looking for the best way to backup this table .

Thanks!

SQL Server Other
0 comments No comments
{count} votes

Accepted answer
  1. Dan Guzman 9,401 Reputation points
    2021-11-08T11:31:11.023+00:00

    You mention backup but do you actually mean copy the partitioned table from one database to another?

    There is no object-level backup/restore in SQL Server. A normal backup includes the entire database and a restore includes all objects. Specialized filegroup/file backups can be leveraged to reduce recovery time but the key point is backups are essentially storage-level operations used to restore an entire database as part of a recovery plan, not to selectively copy objects from one database to another.

    There a number of options to make an copy of a table, partitioned or not. The appropriate one depends on how how you plan to use the backup copy. For example, if your goal is to have a backup copy of the data in another database on the same instance to recover from a problem ETL process, you could simply use SELECT...INTO, which will be minimally logged when the target db is in the SIMPLE recovery model. There's no need to bother with partitioning the backup table in that case.


2 additional answers

Sort by: Most helpful
  1. Tom Phillips 17,771 Reputation points
    2021-11-08T14:29:49.347+00:00

    All "backups" include everything in the database. There is nothing special about partitioned tables.


  2. Seeya Xi-MSFT 16,586 Reputation points
    2021-11-09T07:03:20.027+00:00

    Hi anonymous user ,

    Welcome to Microsoft Q&A!
    I agree with your guess.
    There are also some other methods of copying tables that I put here.
    https://www.sqlshack.com/how-to-copy-tables-from-one-database-to-another-in-sql-server/

    Best regards,
    Seeya


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.