Solved

Error importing into MSSQL when importing from AD Server

Posted on 2013-01-02
3
388 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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:Eugene Z
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

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
push and Pull replication 31 48
disk usage reporting tools 27 57
Find special characters using tSQL 6 20
SQL Query Across Multiple Tables - Help 5 25
Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

730 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