Generate script in SQL Server Management Studio

前端 未结 3 1604
轮回少年
轮回少年 2020-11-28 09:26

If I have a table with data in a database in SQL Server, how can I generate a script that will create the table and add the data too?

If I right click on the table

3条回答
  •  青春惊慌失措
    2020-11-28 09:43

    Here what you have to do:

    1. right click the database (not the table) and select tasks --> generate scripts
    2. Next --> select the requested table/tables (from select specific database objects)
    3. next --> click advanced --> types of data to script = schema and data
    4. next and finish

提交回复
热议问题