简体   繁体   English

在 SQL 服务器的本地实例上创建用户登录 - 对于 Azure AD 用户

[英]Create user login on a local instance of SQL Server - for an Azure AD user

I have a local instance of SQL Server installed.我安装了 SQL 服务器的本地实例。 I installed it as the machine's administrator.我以机器管理员的身份安装了它。

Now I want to create a user for a database on that server, but the user is not a local windows user, but an Azure AD user.现在我想在该服务器上为数据库创建一个用户,但该用户不是本地 windows 用户,而是 Azure AD 用户。

I tried to execute the code mentioned in the Create SQL Login for Azure Active Directory User我尝试执行为 Azure Active Directory 用户创建 SQL 登录中提到的代码

CREATE USER [alice@fabrikam.onmicrosoft.com] 
FROM EXTERNAL PROVIDER;

but I always get the error:但我总是得到错误:

Incorrect syntax near 'PROVIDER' 'PROVIDER' 附近的语法不正确

Now to reiterate, it is not an Azure SQL database, it's a machine's local SQL Server hosting its own databases.现在重申,它不是一个 Azure SQL 数据库,它是一台机器的本地 SQL 服务器托管自己的数据库。

Unfortunately, you can't use Azure AD user for on-premises SQL Server user.不幸的是,您不能将 Azure AD 用户用于本地 SQL 服务器用户。

The link you have shared is only applicable for Azure PaaS services like Azure SQL Database, Azure Managed Instance, etc. The link you have shared is only applicable for Azure PaaS services like Azure SQL Database, Azure Managed Instance, etc.

As per this official doc根据这个官方文档

在此处输入图像描述

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

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