Solved

Error importing into MSSQL when importing from AD Server

Posted on 2013-01-02
3
381 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

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

895 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now