---
title: "How to Backup a Table in SQL Server"  
description: "How to Backup a Table in SQL Server"  
author: "AVADHESH PATEL"  
published: 2012-09-15  
updated: 2020-04-18  
canonical: https://www.mindstick.com/articles/1005/how-to-backup-a-table-in-sql-server  
category: "database"  
tags: ["database"]  
reading_time: 2 minutes  

---

# How to Backup a Table in SQL Server

There is not [standard](https://www.mindstick.com/articles/23223/naming-convention-or-coding-standard) method for [backing up](https://www.mindstick.com/forum/158376/what-are-some-common-techniques-for-backing-up-and-restoring-mongodb-databases) a [table in SQL](https://www.mindstick.com/forum/205/find-the-all-column-with-schema-for-any-table-in-sql-server) Server. A common request I receive from clients is to only backup specific tables within a database. Well, unfortunately there is no out of the box method for doing this akin to a [database backup](https://www.mindstick.com/forum/33859/sqlite-database-backup) so we need to roll our own way.\

It is usually done one of two ways. The first is to use a select into method to copy the table. The other way is to script the table out using the Generate Scripts Tasks. Both methods have positives and negatives. First off, the SELECT INTO Method is by far the fastest. It can copy a large number of rows very quickly, the downfall to this however, is that it does not carry over the Keys, Indexes or [Constraints](https://www.mindstick.com/forum/34816/what-is-mapping-constraints-in-database-management-system). The Generate Scripts method is slow (and I don’t recommend it for very large tables), however it can facilitate copying over any of the other objects associated with the table. Let’s look at the generate scripts task:

First, right click on the database that contains the table you want to backup and choose Tasks -> Generate Scripts.

![How to Backup a Table in SQL Server](https://www.mindstick.com/mindstickarticle/9ec3ccda-8854-4c1d-93d0-db566cc5201f/images/59a88770-ab00-40f6-b76c-796daad23d0e.png)

The Generate Scripts Wizard Appears. Select “Next” past the splash screen then select the database that contains the table. The next screen that appears is the Script Options.

![How to Backup a Table in SQL Server](https://www.mindstick.com/mindstickarticle/9ec3ccda-8854-4c1d-93d0-db566cc5201f/images/1465de3f-94f2-47b5-9905-31cd705f782a.png)

Scroll down on the script options until you see Table/View Options. We want the following to be true: Check Constraints, Script Data, [Foreign Keys](https://www.mindstick.com/forum/159031/how-can-i-list-all-foreign-keys-referencing-a-table-in-sql-server), [Primary Keys](https://www.mindstick.com/forum/156008/how-do-you-set-two-primary-keys-in-access), [Triggers](https://www.mindstick.com/articles/337000/what-are-sql-triggers-and-ways-of-using-them-effectively), & Unique Keys. (Or you can choose whatever you need of course). Select Next and we are presented with the Select Object Types Screen.

![How to Backup a Table in SQL Server](https://www.mindstick.com/mindstickarticle/9ec3ccda-8854-4c1d-93d0-db566cc5201f/images/fa230fe1-c555-4d09-8b8a-0d9f65811766.png)

Select Tables and hit next. Lastly, choose the table or tables you want to backup and hit next.

![How to Backup a Table in SQL Server](https://www.mindstick.com/mindstickarticle/9ec3ccda-8854-4c1d-93d0-db566cc5201f/images/bdb3a5f6-a2ef-4126-aef5-82844bd36170.png)

The last dialog provides the medium you want to output the script to. If you are backing up a large table, I suggest you output to a file.

\

---

Original Source: https://www.mindstick.com/articles/1005/how-to-backup-a-table-in-sql-server

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
