将SQL/LDAP查询限制为901行 [英] Limit SQL/LDAP Query to 901 Rows
本文介绍了将SQL/LDAP查询限制为901行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在ADO.NET SSIS包中使用了以下LDAP/SQL查询,并且我试图弄清楚如何将行限制为901:
I have the following LDAP/SQL Query being used in an ADO.NET SSIS Package and I am trying to figure out how to limit the rows to 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'
推荐答案
尝试一下:
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
这篇关于将SQL/LDAP查询限制为901行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文