简体   繁体   English

如何在 POWERBI 中加入多数据库 SQL 查询

[英]How Can I join Multiple database SQL query in POWERBI

When I get data from SQL Server ,当我从 SQL Server 获取数据时,

It asks me database(optional) but I cant skip it.它问我数据库(可选)但我不能跳过它。

example query below下面的示例查询

select 
 *
from example1.dbo.table1  CP 
inner join example2.dbo.table2 CC on CC.exampleId=CP.Id
inner join example3.dbo.table3 CT on CC.Id=CT.exampleId
where B.Id='" & Id & "' and CP.Id in
(
select xId from example1.dbo.table1 
where Id='" & Id & "'
)

So I need to join 3 tables from 3 database.所以我需要从 3 个数据库中加入 3 个表。 BTW I know server and I have admin account.顺便说一句,我知道服务器并且我有管理员帐户。 With a single admin account I can connect that 3 database.使用一个管理员帐户,我可以连接那 3 个数据库。

I tried import mode, It asks me database.我试过导入模式,它问我数据库。 When I write one of that 3 database name into that place,当我将 3 个数据库名称中的一个写入该位置时,

Details: "Microsoft SQL: The target principal name is incorrect.  Cannot generate SSPI context.

How can I solve that problem.我该如何解决这个问题。

You can find additional details on that specific error here您可以在此处找到有关该特定错误的其他详细信息

When you connect to the SQL Database make sure you are selecting the correct authentication mechanism.当您连接到 SQL 数据库时,请确保您选择了正确的身份验证机制。 Windows is for your network login and password. Windows 用于您的网络登录名和密码。 Database is for a SQL username and password and Microsoft account is for an Azure AD account (eg what you would use to log in to Exchange Online or Office 365).数据库用于 SQL 用户名和密码,Microsoft 帐户用于 Azure AD 帐户(例如,用于登录 Exchange Online 或 Office 365 的帐户)。

在此处输入图片说明

BTW I solved that .顺便说一句,我解决了。

I used OLE DB mode Instead of SQL Server - Import我使用OLE DB模式而不是SQL Server - Import

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

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