简体   繁体   English

SQL Azure中的内部版本号

[英]Build Number in SQL Azure

I have an Azure web service and accompanying sql-azure db that both need to expose a version number. 我有一个Azure Web服务和随附的sql-azure db,都需要公开一个版本号。 The service is straight forward: update the assemblyinfo to generate based on revision & build, and just expose that. 该服务很简单:更新assemblyinfo以基于修订和构建生成,然后公开该信息。

How can I do something similar in the db? 如何在数据库中执行类似的操作? I had toyed with an auto-incremented number, but that increments the 'version' even if I deploy the same bits twice and does not guarantee continuity across servers with the same bits. 我曾玩过一个自动递增的数字,但是即使我两次部署相同的位,这也会增加“版本”,并且不能保证具有相同位的服务器之间的连续性。 And, because it's sql-azure, I don't believe I can pull the value from assemblyinfo, can I? 而且,因为它是sql-azure,所以我不相信我可以从assemblyinfo中获取值,可以吗?

If I can expose the same build number the service shows, that'd be great, but it's not required. 如果我可以公开该服务显示的内部版本号,那将是很好的,但这不是必需的。

  1. Have a Version table in the database 在数据库中有一个Version表
  2. Use a custom MSBuild Task to get the build number 使用自定义MSBuild任务获取内部版本号
  3. You can update a sql file with the 'MERGE' with build number using FileUpdate MSBuild community task 您可以使用FileUpdate MSBuild社区任务使用带有生成编号的“ MERGE”更新sql文件
  4. Execute it as part of deployment. 作为部署的一部分执行它。

Now, you'll have same version number in both database & your assemblies. 现在,数据库和程序集中的版本号都相同。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Azure SQL 数据库行号无法正常工作 - Azure SQL Database Row Number not working properly Azure SQL 更新行、向现有列添加数字的最佳方式 - Azure SQL best way to update a row, add a number to existing column FOR JSON 路径在 AZURE SQL 上返回较少的行数 - FOR JSON path returns less number of Rows on AZURE SQL Azure SQL 表大小与行数不一致 - Azure SQL table size grows inconcistently with number of rows 构建错误 SQL46005:预期 FILESTREAM_ON 但在尝试为 Azure Synapse SQL 池构建数据库项目时遇到 object - Build error SQL46005: Expected FILESTREAM_ON but encountered object instead when trying to build a database project for Azure Synapse SQL pool SQL Azure到SQL数据库 - SQL Azure to SQL database 建立一个sql sql语法 - build a sql sql syntax T-SQL (Azure Synapse) 基于未知数量主键的动态分组 - T-SQL (Azure Synapse) Dynamic grouping based on unknown number of Primary Keys Azure Sql数据仓库表记录的最大列数和最大大小是多少? - What is the maximum number of columns and size for Azure Sql Data warehouse table record? 尝试构建一个 SQL 查询 (MySQL) 来计算一年中每个月的每个设施的预订数量 - Trying to build an SQL query (MySQL) that counts the number of bookings of each facility, for each month of the year
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM