简体   繁体   中英

Azure SQL Vertical Elastic Query tutorial error

I am following the Microsoft tutorial for vertical elastic querying at https://docs.microsoft.com/en-us/azure/sql-database/sql-database-elastic-query-getting-started-vertical

I entered the code as follows:

CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'redacted'; 
CREATE DATABASE SCOPED CREDENTIAL ElasticDBQueryCred
WITH IDENTITY = 'redacted',
SECRET = 'redacted';

CREATE EXTERNAL DATA SOURCE MyElasticDBQueryDataSrc WITH
    (TYPE = RDBMS,
    LOCATION = 'redactedazure.database.windows.net',
    DATABASE_NAME = 'Redacted_Staging',
    CREDENTIAL = ElasticDBQueryCred,
    );

CREATE EXTERNAL TABLE [dbo].[CustomerInformation]
( [CustomerID] [int] NOT NULL,
  [CustomerName] [varchar](50) NOT NULL,
  [Company] [varchar](50) NOT NULL)
WITH
( DATA_SOURCE = MyElasticDBQueryDataSrc)

SELECT OrderInformation.CustomerID, OrderInformation.OrderId, CustomerInformation.CustomerName, CustomerInformation.Company
FROM OrderInformation
INNER JOIN CustomerInformation
ON CustomerInformation.CustomerID = OrderInformation.CustomerID;

However, I am getting the following errors:

Msg 46823, Level 16, State 1, Line 1 Error retrieving data from redactedazure.database.windows.net.Redacted_Staging. The underlying error message received was: 'Error retrieving data from redactedazure.database.windows.net.Redacted_Staging. The underlying error message received was: 'Error retrieving data from... (repeats)

Any idea why?

Did you ensure you possess ALTER ANY EXTERNAL DATA SOURCE permission?

ALTER ANY EXTERNAL DATA SOURCE permissions are needed to refer to the underlying data source.

You can see: Vertical partitioning - cross-database queries

在此处输入图片说明

Hope this can helps you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM