gpt4 book ai didi

sql-server-2008 - 从 sql server 2008 查询 AD 描述字段给出错误

转载 作者:行者123 更新时间:2023-12-01 12:55:45 27 4
gpt4 key购买 nike

我正在尝试使用以下 SQL 查询查询 Active Directory,它运行良好。

SELECT * FROM OpenQuery(ADSI, 
'SELECT title, displayName, sAMAccountName, givenName,
telephoneNumber, facsimileTelephoneNumber, sn,
mail, physicalDeliveryOfficeName
FROM ''LDAP://DC=mydomain,DC=org''
WHERE sAMAccountName = ''myUser''')

当我添加 description 属性时,出现以下错误:

Msg 7346, Level 16, State 2, Line 6
Cannot get the data of the row from the OLE DB provider "ADSDSOObject" for linked server "ADSI". Could not convert the data value due to reasons other than sign mismatch or overflow.

最佳答案

Active Directory 中的 SQL/ADO 查询功能非常有限 - 我会尽可能避免使用它们。

这里的原因是 Active Directory 中的 description 属性是多值的 - 它可能包含多个值(这在关系数据库模型中是不可能的)。

因此,SQL/ADO 查询提供程序不能从 LDAP 中读取任何这些多值属性 - 没有办法或选项或复选框来启用它 - 这是不可能的。

关于sql-server-2008 - 从 sql server 2008 查询 AD 描述字段给出错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9911360/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com