sql - 尝试将数据库发布到没有聚集索引的 Azure 时出错

标签 sql sql-server azure webmatrix

尝试将数据库发布到 Azure 站点时出现以下错误:

17:13:29: Could not publish the site. Unable to publish the database. For more information, see "http://go.microsoft.com/fwlink/?LinkId=205387"
17:13:29: Error detail:
17:13:29: An error occurred during execution of the database script. The error occurred between the following lines of the script: "332" and "334". The verbose log might have more information about the error. The command started with the following:
17:13:29: "INSERT [dbo].[DBStatus] ([LastIndex], [LastUpdated"
17:13:29:  Tables without a clustered index are not supported in this version of SQL Server. Please create a clustered index and try again. http://go.microsoft.com/fwlink/?LinkId=178587
17:13:29:   Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_SQL_EXECUTION_FAILURE.

此链接解释了错误:http://blogs.msdn.com/b/sqlazure/archive/2010/04/29/10004618.aspx

有没有一种简单的方法可以将我的数据库转换为具有聚集索引,或者我应该选择具有 SQL Server 2012 托管的主机?

最佳答案

我不会仅仅因为这个而改变您的托管选项。添加聚集索引。

有一个工具叫 SQL Database Migration Wizard它可以分析 SQL 数据库并制作迁移脚本,甚至移动数据。它要做的事情之一是建议在没有聚集索引的表上建立聚集索引。然而,与任何工具一样,请确保您查看它的建议并看看它在您的场景中是否有意义。

我的建议是查看没有聚集索引的表并确定要创建的合理索引。像上面这样的工具可以提出建议,但它们只是建议,可能并不完全是您的 table 能从中受益的。

Azure SQL 数据库对聚集索引的要求来自于这样的事实:它们一式三份地复制数据,而聚集索引使该过程更快。

关于sql - 尝试将数据库发布到没有聚集索引的 Azure 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19347400/

相关文章:

mysql - 合并所有 sql 中的结果

sql - 为什么 SQL Server 为初始数据库角色创建模式?

sql - 在选择列表中无效,因为它不包含在聚合函数或 GROUP BY 子句中

SQL:如果我的最大值是 255,使用 tinyint 而不是 Integer 是否有效?

PHP set Hash 与 Swift 应用程序的 Checked hash 不同

mysql - 如何找到从事完全相同项目的 worker 数量

java - 如何在 Java 中创建动态预准备语句?

c# - 托管我的网站和数据库的 Azure 服务器上的 DateTime.Now 与 DateTime.UtcNow

azure - 无法通过 azure 自动化 Runbook 创建存储帐户

Azure Synapse 无服务器 CETAS 错误 "External table location is not valid"