none
How to Limit Rows in ADO query from Active Directory for SQL or Crystal Reports

    Question

  • How do i Limit the number of rows displayed with a SQL Command or Syntax statement? I have tried LIMIT but that does not work.

    SELECT CN, OperatingSystem

    FROM 'LDAP://DC=domain,DC=edu' WHERE objectClass='computer'

    LIMIT 900

    OR 

    SELECT CN, OperatingSystem SELECT TOP 100 CN FROM 'LDAP://OU=EUC_Devices,OU=CHMC,OU=SCAL,OU=Regional_Sites,DC=domain,DC=edu' WHERE objectClass='computer'

    OR

    SELECT TOP 100 CN, OperatingSystem FROM 'LDAP://OU=EUC_Devices,OU=CHMC,OU=SCAL,OU=Regional_Sites,DC=domain,DC=edu' WHERE objectClass='computer'

    Monday, January 9, 2017 2:23 PM

All replies

  • Hi,
    First of all, we appreciate you for posting questions in the Directory Services forum. However, in my opinion, regarding the questions about SQL or Crystal reports, we would suggest you post the questions in the SQL Server forum:
    https://social.technet.microsoft.com/Forums/windowsserver/en-US/home?forum=sqldataaccess
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.
    Best regards,
    Wendy

    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Tuesday, January 10, 2017 6:31 AM
    Moderator