`
1000copy
  • 浏览: 72837 次
  • 性别: Icon_minigender_1
  • 来自: 成都
文章分类
社区版块
存档分类
最新评论

Visual studio 2010 Database Project 的命令行发布方法

阅读更多

“声明型数据库发布”在IDE内操作起来是非常方便的。但是在做安装包给用户的时候,或者在DailyBuild服务器上不可能也不应该安装Visual Studio。还好MS提供了auto deploy的命令行方法。这个命令叫做vsdbcmd 。

 

这是一个vsdbcmd的运行命令行的模板

 

Cd <PROJECT_HOME>\sql\debug\

vsdbcmd /ManifestFile:PROJECT_NAME.deploymanifest /a:Deploy /cs:"Data Source=DBSERVER;Persist Security Info=True;User ID=DB USER;Password=DB PASSWORD;Pooling=False" /p:GenerateDropsIfNotInProject=True /p:BlockIncrementalDeploymentIfDataLoss=False /p:TargetDatabase=DATABASE /p:IgnorePermissions=True /p:GenerateDeployStateChecks=False /dd:+

 

 

Vsdbcmd 命令解释

非常复杂的vsdbcmd命令行。简单做一个解释:

/ManifestFile:表明后面跟着一个发布Manifest(清单)文件,里面涉及到诸如dbschema,Pre deploy File,Post deploy File之类的文件的所在位置和名称——这些文件都是Database project 在构建后生成的文件,在sql\debug目录下。用于发布的信息都在这个Manifest文件内做统一的登记。

 

/cs:表明跟着的信息就是连接字符串,指向要升级的数据库的连接信息。

/p: 指名后面是参数和它的值。

/p:GenerateDropsIfNotInProject=True  如果Database project内没有的对象,是否删除数据库内的对象。

/p:BlockIncrementalDeploymentIfDataLoss=False 如果会导致数据丢失,是否阻塞掉这个发布。

/p:TargetDatabase=DATABASE 指名目标数据库的名称。

 

其他的就没有那么重要,可以查询vsdbcmd的联机文档。

 

我测试了“创建新数据库和升级数据库”两种模式,都通过了。


 

 

分享到:
评论

相关推荐

    Professional UML with Visual Studio .NET—Unmasking Visio for Enterprise Architects (2)

    Professional UML with Visual Studio .NET—Unmasking Visio for Enterprise Architects 第二部分 Table of Contents Professional UML with Visual Studio .NET—Unmasking Visio for Enterprise ...

    Professional UML with Visual Studio .NET—Unmasking Visio for Enterprise Architects (1)

    Professional UML with Visual Studio .NET—Unmasking Visio for Enterprise Architects 第一部分 Table of Contents Professional UML with Visual Studio .NET—Unmasking Visio for Enterprise ...

    Visual Studio.Net(VS) 源码管理器

    一、 开发前的准备1、 在装有Windows 2000或者Windows XP Professional的机器上安装.Net Framework SDK、Visual Studio.Net、Visual Source Safe 6C。(如果用户操作系统是Windows .Net Server,则无须安装.Net ...

    .NET mvc5 code first 教程

    A Visual Studio 2013 project which shows how to use the Entity Framework 6 in an ASP.NET MVC 5 web application project, using the Code First development approach. The previous version that uses EF 5 ...

    Devart dbForge Studio for MySQL Professional Edition v7.1.13

    Save your settings and connections as a project for the next time or to use in the command line. More on dumping MySQL databases Database Administration Tools for MySQL database administration and ...

    水晶报表CrystalReports实例大全

    For more information on security, including how to create a limited access database account, see the SDK Fundamentals section of the Crystal Reports for Visual Studio 2005 documentation. Asp.net2.0...

    Smart Mobile Studio Enterprise v2.0 Build 723 Cracked

    You author the project just like you would do in Delphi or Visual Studio and it’s instantly converted into high-speed javascript. Our philosophy is that the browser is the new operative system. The ...

    MSM 物资管理 .NET 2.0

    开发工具:visual studio2005 开发语言:C# 后台数据库:SQL SERVER 2000 用户名:admin 密码:admin &lt;br&gt;请把文件夹DataBase中的数据文件和日志文件导入数据库中然后再运行login.exe文件 &lt;br&gt;...

    Programming Entity Framework Code First

    use this version of Entity Framework in Visual Studio 2010. When .NET 4 was released, the Entity Framework team was already hard at work on a new addition, called Code First, to provide an alternative...

    codeigniter4-snippets:Visual Studio Code的CodeIgniter4代码段

    Vign的Codeigniter 4片段 该扩展提供了Codeigniter 4片段 要求 CodeIgniter Version : 4.1.1 ...$ routes -&gt; cli ( 'migrate' , 'App\Database::migrate' ); ci4:routes:env 制作路线环境 $ routes

    Programming Entity Framework: Code First

    use this version of Entity Framework in Visual Studio 2010 When NET 4 was released the Entity Framework team was already hard at work on a new addition called Code First to provide an alternative to...

    Beginning Microsoft Visual CSharp 2008 Wiley Publishing(english)

    Visual Studio Setup and Deployment Project Types 634 Microsoft Windows Installer Architecture 635 Creating an Installation Package for the SimpleEditor 639 Building the Project 654 ...

    Hungry Minds - Visual Basic.NET Visual Blueprint (VBL).pdf

    Install Visual Studio .NET....................................................................................................4 Using the Development Studio ..............................................

    SCADA_Project:SCADA大师项目

    SCADA_Project SCADA大师项目入门(无云) 将Project / packages / dnp3_protocol / runtime / dnp3win32.dll到Project / Simulator / bin / Debug 在VisualStudio打开解决方案在Scada.Common和NetowkModelService...

    Testing with F#(PACKT,2015)

    you will learn how to set up your test environment for unit testing and how to execute your test suite within and outside of Visual Studio. Using different test frameworks as MSTest, NUnit, and xUnit...

    Professional ASP.NET MVC 1.0原版第一部分

    He begins NerdDinner by using the File-&gt;New Project menu command within Visual Studio to create a new ASP.NET MVC Application. You'll then incrementally add functionality and features. Along the way ...

    Beginning.Object-Oriented.Programming.with.C#

    the creation of a Windows-based user interface, a web-based user interface, and service-oriented programming, all using Microsoft's industry-leading Visual Studio 2010, C#, Silverlight, the Entity ...

    Beginning C# Object-Oriented Programming

    the creation of a Windows-based user interface, a web-based user interface, and service-oriented programming, all using Microsoft's industry-leading Visual Studio 2010, C#, Silverlight, the Entity ...

    ASP.NET MVC with Entity Framework and CSS

    • How to use Visual Studio Scaffolding views and controllers • Manage CRUD operations including model binding as recommended by Microsoft and dealing with cascading deletions correctly • Input and ...

Global site tag (gtag.js) - Google Analytics