弹性查询错误 [英] Elastic query error

查看:69
本文介绍了弹性查询错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Azure中有2个数据库:

I have 2 db in Azure:

DB1

DB2

根据文档,我创建了主密钥,范围凭证,外部数据安全和外部表:

as from the documentation I created master key, scoped credential, external datasurce and external table:

CREATE MASTER KEY 

CREATE DATABASE SCOPED CREDENTIAL sqluser  
WITH IDENTITY = 'user',  
SECRET = 'password'; 

CREATE EXTERNAL DATA SOURCE REMOTEDB2
WITH  
(  
    TYPE=RDBMS,  
    LOCATION='mydb.database.windows.net',  
    DATABASE_NAME='DB2',  
    CREDENTIAL= sqluser
); 

CREATE EXTERNAL TABLE [dbo].[Department](  
    [DeptId] [int] NOT NULL,  
    [Name] [varchar](50) NULL  
)  
WITH  
(  
    DATA_SOURCE = REMOTEDB2 
);  

我很好,但是当我运行查询时:

Here I'm fine, but when I run the query:

SELECT *  
  FROM [dbo].[Employee] E  
  INNER JOIN [dbo].[Department] D  
  ON E.DeptId = D.DeptId 

我收到此错误:

Messaggio 46823,livello 16,stato 1和riga 26
从mydb.database.windows.net.[DB2]中检索数据时出错.收到的基本错误消息是:'无法打开数据库"[DB2]".登录要求.登录失败.
用户"user"的登录失败.

Messaggio 46823, livello 16, stato 1, riga 26
Error retrieving data from mydb.database.windows.net.[DB2].  The underlying error message received was: 'Cannot open database "[DB2]" requested by the login. The login failed.
Login failed for user 'user'.'.

我花了很多时间,但解决不了

Stefano

推荐答案

Hello,

您是吗使用最新的SQL Server Management Studio?请下载最新版本.

Are you using the latest SQL Server Management Studio? Please download the latest version.

https://docs.microsoft.com/zh-cn/sql/ssms/download-sql-server-management-studio-ssms?view=sql-server-2017

https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms?view=sql-server-2017


请验证外部数据源定义中的数据库名称是否与实际数据库名称不同(查找拼写错误).

希望这会有所帮助.


Please verify the database name in the external data source definition is not the same (look for a typo) as actual database name.

Hope this helps.



问候



Regards,

Alberto Morillo
SQLCoffee.com

Alberto Morillo
SQLCoffee.com


这篇关于弹性查询错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆