MS SQL 2008 - Create a copy of the database without the data

前端 未结 4 789
甜味超标
甜味超标 2021-01-31 08:37

In MS SQL Server 2008 R2, how do I create a new database based on the schema of the old one, but without copying any of the data along with it? I am using SQL Server management

4条回答
  •  半阙折子戏
    2021-01-31 09:26

    In SQL Server Management Studio, you can menu-click on an object and select...

    "Script [Object] As" ... "CREATE to"... "New Query Window"
    

    You would need to create scripts for each object you want to create.

    If you want to do the whole lot, menu-click on the database, and select

    "Tasks" ... "Generate Scripts" and follow the wizard, as per this article:

提交回复
热议问题