Solved

Error importing into MSSQL when importing from AD Server

Posted on 2013-01-02
3
384 Views
Last Modified: 2013-01-10
I am trying to pull data from AD into MSSQL, but I get the following error
Msg 7330, Level 16, State 2, Line 1
Cannot fetch a row from OLE DB provider "ADsDSOObject" for linked server "ADSI".


SELECT * into xADObjects FROM OPENQUERY(ADSI, 'SELECT employeeType, employeeID, department, dNSHostName, accountExpires, whenCreated, whenChanged, userPrincipalName, scriptPath, pwdLastSet, physicalDeliveryOfficeName, objectCategory, lastLogonTimestamp, Name, displayName,givenname,distinguishedName, title, SAMAccountName, telephoneNumber, cn, sn, ou FROM ''LDAP://dc=avantihospitals,dc=local'' WHERE objectClass=''Person'' AND objectClass=''User''')

Open in new window

0
Comment
Question by:epicazo
3 Comments
 

Accepted Solution

by:
FLProfessional earned 250 total points
ID: 38738672
AD MaxPageSize is causing the issue.  AD will only return 1000 records with that query.  The solution is to customize a Stored Procedure to get around the setting.  

Here is an excellent article that will help you with this issue:

http://blog.webactivedirectory.com/2011/06/08/joining-active-directory-data-with-sql-server-data-cannot-fetch-a-row-from-ole-db-provider-yourprovider-for-linked-server-yourlinkedserver/
0
 
LVL 42

Expert Comment

by:EugeneZ
ID: 38738699
check if you are using  Kerberos not hops..
0
 

Author Closing Comment

by:epicazo
ID: 38765344
thanks.  Sorry for delay
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question