Solved

Error importing into MSSQL when importing from AD Server

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

Suggested Solutions

Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

838 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