“声明型数据库发布”在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 第二部分 Table of Contents Professional UML with Visual Studio .NET—Unmasking Visio for Enterprise ...
Professional UML with Visual Studio .NET—Unmasking Visio for Enterprise Architects 第一部分 Table of Contents Professional UML with Visual Studio .NET—Unmasking Visio for Enterprise ...
一、 开发前的准备1、 在装有Windows 2000或者Windows XP Professional的机器上安装.Net Framework SDK、Visual Studio.Net、Visual Source Safe 6C。(如果用户操作系统是Windows .Net Server,则无须安装.Net ...
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 ...
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 ...
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...
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 ...
开发工具:visual studio2005 开发语言:C# 后台数据库:SQL SERVER 2000 用户名:admin 密码:admin <br>请把文件夹DataBase中的数据文件和日志文件导入数据库中然后再运行login.exe文件 <br>...
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...
Vign的Codeigniter 4片段 该扩展提供了Codeigniter 4片段 要求 CodeIgniter Version : 4.1.1 ...$ routes -> cli ( 'migrate' , 'App\Database::migrate' ); ci4:routes:env 制作路线环境 $ routes
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...
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 ...
Install Visual Studio .NET....................................................................................................4 Using the Development Studio ..............................................
SCADA_Project SCADA大师项目入门(无云) 将Project / packages / dnp3_protocol / runtime / dnp3win32.dll到Project / Simulator / bin / Debug 在VisualStudio打开解决方案在Scada.Common和NetowkModelService...
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...
He begins NerdDinner by using the File->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 ...
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 ...
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 ...
• 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 ...