部署Visual Studio 2010数据库项目 [英] Deploy Visual Studio 2010 Database Project

查看:115
本文介绍了部署Visual Studio 2010数据库项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Visual Studio 2010数据库项目,从中我想生成一个脚本
,只是把这个数据库放到另一台机器。问题是我找不到一个
的解决方案。

I have a Visual Studio 2010 Database project, from which I want to generate a script that simply puts up this database to another machine. The problem is that i can't find a solution for this.

当我开始项目,我从我的开发电脑上的数据库导入shema 。
生成Schema对象,并在Schema Objects - > Schemas - > dbo下生成所有表和脚本。随着时间的推移,有些事情发生了变化,有些事情发生了变化。通过右键单击 - > deploy,
,成功地对我的本地数据库进行了更改。

As I started the project, I imported the shema from a database on my development pc. The Schema Objects were generated and all tables and scripts where under 'Schema Objects -> Schemas -> dbo'. Over the time, some things changed, some where added. And by using right-click -> deploy, the changes were made to my local database successfully.

但是现在我想部署到另一台机器。问题是,在项目的发布文件夹中,只有一个xml dbschema文件包含所有表和脚本,我无法导入
与sql管理工作室(或我只是不知道如何)以及部署脚本,这只是一些检查,后面是部署前和部署后脚本,但没有任何表或脚本。

But now I want to deploy to another machine. The problem is, that in the release folder of the project, there is only a xml dbschema file containing all tables and scripts that i can't import with sql management studio (or i just can't find out how) and the a deployment script which is nothing more than some checks followed by the pre- and post- deployment script, but without any tables or scripts in it.

那么请问我如何从Visual Studio导出数据库,所以我可以很容易地把它放在另一台机器上?

So please, how do i export the database from Visual Studio, so i can easily put it up on another machine?

推荐答案

是否可以将Visual Studio指向您的新目标数据库? 1.您的数据库项目的属性,部署选项卡,设置目标数据库设置中的字段。

Is it's possible to point your Visual Studio to your new target database? 1. Properties of your Database project, Deploy tab, set the fields in Target Database Settings.

现在生成部署脚本时,生成的SQL文件将是各种CREATe / ALTER / DROP等,它们将使目标数据库与您的模式一致。

Now when you generate a deploy script, the resulting SQL file will be the various CREATe / ALTER / DROP etc that will align the target database with your schema.

这篇关于部署Visual Studio 2010数据库项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆