数据库项目

编程入门 行业动态 更新时间:2024-10-13 18:25:40
本文介绍了数据库项目 - 生成脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

Visual Studio数据库项目提供生成脚本,它还会创建增量数据库更改。

Visual studio database project offers Generate Script and its also creates an incremental DB changes.

我可以使用msbuild或命令行或任何其他第三方组件生成脚本。

Can I generate scripts using msbuild or command line or any other third party component.

推荐答案

您好satyajit015,

Hi satyajit015,

感谢您在这里发帖。

您的意思是根据生成的dacpac文件和实际数据库生成发布脚本吗?如果是,请您可以使用SqlPackage.exe 。在你的机器上查找它与a名称相似的目录:

Do you mean generate the publish script based on the generated dacpac file and the actual database? If yes, you can use SqlPackage.exe. Look for it on your machine in a directory with a name similar to this:

C:\Program Files(x86)\ Microsoft SQL Server \130 \ DAC \ bin

C:\Program Files (x86)\Microsoft SQL Server\130\DAC\bin

请注意,它可以在110,120或130文件夹中找到。

Note that it may be found in the 110, 120 or 130 folder.

如果您还没有SqlPackage.exe ,您可以从这里下载: www.microsoft。 com / zh-CN / download / details.aspx?id = 51941

If you don't have SqlPackage.exe already, you can download it from here: www.microsoft/en-us/download/details.aspx?id=51941

如果您下载它,请务必查看下载页面的"系统要求"部分以查找依赖项SqlSysClrTypes.msi和SqlDom.msi,也必须安装。

If you download it, be sure to look in the System Requirements section of the download page to find the dependencies SqlSysClrTypes.msi and SqlDom.msi, which must be installed as well.

示例用法:

SqlPackage.exe / a:script / SourceFile:C:\ temp \mydb.dacpac / TargetConnectionString:" Data Source = myserver; Initial Catalog = mydb; Integrated Security = true" / OutputPath:C:\ temp

SqlPackage.exe /a:script /SourceFile:C:\temp\mydb.dacpac /TargetConnectionString:"Data Source=myserver;Initial Catalog=mydb;Integrated Security=true" /OutputPath:C:\temp

有关更详细的信息,请参阅:

For some more detailed info, you can refer to:

stackoverflow/questions/45943575/build-and-generate-script -for-ssdt-project-using-command-line-tools

希望这会有所帮助。

更多推荐

数据库项目

本文发布于:2023-07-15 13:04:31,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1111390.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:数据库   项目

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!