我在ADO.NET SSIS包中使用了以下LDAP / SQL查询,我试图弄清楚如何将行限制为901:
SELECT
displayName,
cn,
extensionAttribute5,
streetAddress,
telephoneNumber,
otherTelephone,
info,
department,
company,
givenName,
mobile,
physicalDeliveryOfficeName,
facsimileTelephoneNumber,
sn,
title,
mail
FROM
'LDAP://OU=*****,OU=*****,OU=*****,DC=*****,DC=*****,DC=*****'
WHERE
objectCategory = 'Person' AND
objectClass = 'User'
答案 0 :(得分:0)
试试这个:
with x as(
SELECT * FROM OpenQuery (
ADSI,
'SELECT
adspath,
samaccountname
FROM
''LDAP:// ...''
WHERE
objectClass = ''User''
order by samaccountname
') AS tblADSI
)
select
top 901
adspath,
samaccountname
from
x