仅备份 SQL 架构?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3589/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 23:04:55  来源:igfitidea点击:

Backup SQL Schema Only?

sqlsql-serveroraclesql-server-2005backup

提问by Tom Grochowicz

I need to create a backup of a SQL Server 2005 Database that's only the structure...no records, just the schema. Is there any way to do this?

我需要创建一个 SQL Server 2005 数据库的备份,它只是结构......没有记录,只有架构。有没有办法做到这一点?

EDIT: I'm trying to create a backup file to use with old processes, so a script wouldn't work for my purposes, sorry

编辑:我正在尝试创建一个备份文件以用于旧进程,因此脚本无法满足我的目的,抱歉

采纳答案by Greg Hurlman

Use a 3 step process:

使用 3 步过程:

  1. Generate a script from the working database
  2. Create a new database from that script
  3. Create a backup of the new database
  1. 从工作数据库生成脚本
  2. 从该脚本创建一个新数据库
  3. 创建新数据库的备份

回答by Brandon Wood

Why not just use SQL Management Studio to create a complete script of your database and the objects?

为什么不直接使用 SQL Management Studio 来创建数据库和对象的完整脚本?

回答by mauriciopastrana

I make heavy use of this tool:
SQLBalance for MySQL

我大量使用这个工具:
SQLBalance for MySQL

Unfortunately; its windows only... but works like a charm to move databases around, data or no data, merge or compare.

很遗憾; 它仅适用于窗口……但它的作用就像一个魅力,可以移动数据库、数据或无数据、合并或比较。

回答by Mark Harrison

Toad for SQL Server does this nicely, if you're considering a commercial product.

如果您正在考虑使用商业产品,Toad for SQL Server 可以很好地做到这一点。