Solved

Error importing into MSSQL when importing from AD Server

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
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.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
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.

758 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

20 Experts available now in Live!

Get 1:1 Help Now