Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question on OpenRowSet and PageSize

Status
Not open for further replies.

FancyPrairie

Programmer
Oct 16, 2001
2,917
US
I've added Active Directory as a linked server so I can query Active Directory using OpenQuery. The query looks something like this:
Code:
SELECT *
FROM OPENQUERY(ADSI,
    'SELECT sn
     FROM ''LDAP://OU=whatever,DC=whatever'' 
     WHERE objectCategory = ''Person'' AND 
           objectClass= ''user'' ')
The problem with this query is that it only displays 1000 records. I know I can change the MaxPageSize on the server, but, for various reason, cannot do that.

Supposedly I should be able to change the Page Size using OpenRowSet rather than OpenQuery. But I still can't seem to get the query to display more than 1000 records.

Here's my query. What am I doing wrong?
Code:
SELECT *
FROM OPENROWSET('AdsDsoObject', 'User ID=Me;Password=MyPassword;ADSI Flag=0x11;Page Size=10000', 
     'SELECT sn
      FROM ''LDAP://OU=whatever,DC=whatever''
    WHERE
        objectCategory = ''Person''
        AND objectClass = ''user'' ')
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top