sql - 如何将数据库部署到 windows azure sql 数据库?

标签 sql azure azure-sql-database

我有一个位于本地 SQL Server 上的数据库。我转到 Management Studio,然后选择要在 Azure 上部署的数据库并按照指南进行操作。最终,我收到了一堆错误,例如

One or more unsupported elements were found in the schema used as part of a data package. Error SQL71561: Error validating element [dbo].[patientInfo]: View: [dbo].[patientInfo] has an unresolved reference to object [198.18.21.71].[db_cs_dw].[dbo].[invoice]. External references are not supported when creating a package from this platform.

Error SQL71562: Error validating element [dbo].[getAllClaimsByPatientId]: Procedure: [dbo].[getAllClaimsByPatientId] has an unresolved reference to object [198.18.21.71].[db_cs_dw].[dbo].[all_clients_view]. External references are not supported when creating a package from this platform.

我是否需要在我的 Azure sql 服务器上使用 [198.18.21.71] 设置链接服务器。我可以这样做吗?

最佳答案

正如其他人正确指出的那样,您无法在 Azure 中设置链接服务器。您看到的验证失败是因为检测到由 4 部分组成的 [服务器].[数据库].[架构].[表] 引用,而 Azure 不支持这些引用。

假设您的 [db_cs_dw] 数据库也将托管在 Azure 中,您可以执行 Elastic Query执行跨数据库查询。执行此操作需要进行一些设置,包括创建安全上下文、数据源和 External Tables表示 [invoice] 表或您希望在其他数据库中访问的任何其他数据。您对 [198.18.21.71].[db_cs_dw].[dbo].[invoice] 的旧引用现在将引用外部表。您还可以通过引入 Synonyms 来进一步封装它- 因此同义词引用外部表,[dbo].[patentInfo] View 将引用该同义词。

否则,您将需要在同一数据库中托管数据,并采用某种 ETL/复制流程来移动/同步数据。

关于sql - 如何将数据库部署到 windows azure sql 数据库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42008995/

相关文章:

powershell - 将托管操作系统磁盘快照还原到现有 VM

Azure CLI - 无法使用 az 工件通用下载来下载包

asp.net - Application Insights 扩展破坏了 Azure Web 应用程序

azure - 创建 SQL 数据库时设置 Azure 管理员意味着什么?我应该为管理员选择哪个值?

azure - Sql Azure - 查询超时

sql - 在 SQL Server 2008 中插入表使用数组

SQLite 在同一张表上两次加入

php - 如何从MySQL中的单个表中选择依赖列

sql-server - 无法使用新登录名登录 Azure VM SQL Server 2014

sql - 我正在运行 xampp mysql 服务器,如何运行代码?