Backup a single table with its data from a database in sql server 2008

后端 未结 10 1712
青春惊慌失措
青春惊慌失措 2020-12-02 07:18

I want to get a backup of a single table with its data from a database in SQL Server using a script.

How can I do that?

10条回答
  •  甜味超标
    2020-12-02 07:40

    You can use the "Generate script for database objects" feature on SSMS.

    1. Right click on the target database
    2. Select Tasks > Generate Scripts
    3. Choose desired table or specific object
    4. Hit the Advanced button
    5. Under General, choose value on the Types of data to script. You can select Data only, Schema only, and Schema and data. Schema and data includes both table creation and actual data on the generated script.
    6. Click Next until wizard is done

    This one solved my challenge.
    Hope this will help you as well.

提交回复
热议问题