面向项目的脱机数据库开发Project-Oriented Offline Database Development

本节介绍 SQL Server Data Tools (SSDT) 提供的用于创作、生成、调试、发布和部署数据库项目的功能。This section describes features provided by SQL Server Data Tools (SSDT) for authoring, building, debugging and publishing a database project.

使用 SSDT,你可以创建一个脱机数据库项目,并且可以在该项目中通过添加、修改或删除对象的定义(由脚本表示)实施架构更改,而无需连接到某一服务器实例。Using SSDT, you can create an offline database project and implement schema changes by adding, modifying or deleting the definitions of objects (represented by scripts) in the project, without a connection to a server instance. 这些都可以通过使用表设计器或 Transact-SQL 编辑器来实现。These can all be accomplished by using the table designer, or the Transact-SQL Editor. 你还可以在同一个项目中编写和调试 Transact-SQL 和 CLR 对象。You can also write and debug Transact-SQL and CLR objects in the same project. 您可以使用架构比较来确保您的项目与生产数据库保持同步,并且出于比较目的在开发周期的每个阶段中为您的项目创建快照。You can use Schema Compare to ensure that your project stays in sync with the production database, and create snapshots for your project in each stage of the development cycle for comparison purposes. 当您在基于团队的环境中处理您的数据库项目时,可以将版本控制用于所有文件。While you are working on your database projects in a team-based environment, you can employ version control for all the files. 在开发、测试和调试了您的数据库项目后,可以将您的项目提交给授权人士,以便发布到生产环境。After your database project has been developed, tested and debugged, you can hand off your project to authorized personnel to be published to a production environment.

备注

本节中的操作指南主题包含一系列可按顺序完成的任务。How To topics in this section contain a series of tasks that can be completed in a sequence.

本节内容In This Section

主题Topic 描述Description
导入到数据库项目Import into a Database Project 介绍从活动的数据库、.dacpac 或脚本导入对象。Describes importing objects from a live database, .dacpac, or script.
“添加数据库引用”对话框Add Database Reference Dialog Box 介绍添加数据库引用的各种方式。Describes various ways to add a database reference.
“检查更新”对话框Check for Updates Dialog Box 说明 SQL Server Data Tools 如何检查产品更新。Describes how SQL Server Data Tools can check for product updates.
数据库项目设置Database Project Settings 介绍各种项目设置来控制数据库和生成配置的各个方面。Describes various project settings to control aspects of your database and build configurations.
如何:在 SQL Server 数据库项目中浏览对象How to: Browse Objects in a SQL Server Database Project Visual Studio 中的 SQL Server 对象资源管理器现在包含一个已不推荐使用的“项目”节点,在该节点下,你的解决方案中的所有 SQL Server 数据库项目都在类似 SQL Server Management Studio 的层次结构下进行分组。The SQL Server Object Explorer in Visual Studio now contains a dedicated Projects node, under which all SQL Server database projects in your solution are grouped in an SQL Server Management Studio-like hierarchy.
“数据工具操作”窗口Data Tools Operations Window 介绍 “数据工具操作” 窗口,该窗口会显示某些操作的进度并告知您任何错误。Describes the Data Tools Operations window, which shows the progress of some operations and notifies you of any errors.
Transact-SQL 编辑器选项Transact-SQL Editor Options 说明 Transact-SQL 选项。Describes Transact-SQL options.
如何:创建新的数据库项目How to: Create a New Database Project 创建一个数据库项目并导入现有数据库架构。Create a database project and import existing database schema.
如何:使用架构比较来比较不同数据库定义How to: Use Schema Compare to Compare Different Database Definitions 比较数据库和项目的架构并保持同步。Compare the schemas of a database and a project and sync up.
如何:生成并部署到本地数据库How to: Build and Deploy to a Local Database 使用本地的按需运行的 SQL Server 实例,该实例是在你调试数据库项目时激活的。Use the local on-demand SQL Server instance, which is activated when you debug a database project.
如何:更改目标平台并发布数据库项目How to: Change Target Platform and Publish a Database Project 将项目的目标 SQL Server 平台更改为 SQL Server 的任何支持的实例并验证语法。Change the target SQL Server platform for your project to any supported instance of SQL Server and validate syntax.
如何:创建项目快照How to: Create a Snapshot of a Project 创建数据库架构的只读代理,并且在不想要的更改应用于项目时还原源项目。Create a read-only proxy of the database schema, and revert the source project when unwanted changes are applied to the project.
如何:在项目中使用 Microsoft SQL Server 2012 对象How to: Use Microsoft SQL Server 2012 Objects in Your Project 向您的项目添加一个新的序列对象。Add a new Sequence object to your project.
如何:处理 CLR 数据库对象How to: Work with CLR Database Objects 在 SQL Server Data Tools 数据库项目中创建和发布 CLR 对象。Create and publish CLR objects in the SQL Server Data Tools Database project.
如何:将 Visual Studio 2010 数据库项目转换为 SQL Server 数据库项目并重新定位到其他平台How to: Convert a Visual Studio 2010 Database Projects to SQL Server Database Projects and Retarget to a Different Platform 将在 Visual Studio 2010 中创建的现有 SQL Server 数据库、CLR 对象和数据层应用程序项目转换为 SQL Server Data Tools 数据库项目。Convert existing SQL Server Database, CLR objects, and Data-Tier Application projects created in Visual Studio 2010 to the SQL Server Data Tools Database project.
如何:指定预先部署或后期部署脚本How to: Specify Predeployment or Postdeployment Scripts 论述如何使用在部署您的数据库之前或之后您要运行的脚本。Discusses how to use scripts that you want to run before or after the deployment of your database.

管理表、关系和修复错误Manage Tables, Relationships, and Fix Errors