Good Day Sagarp
if you have a This Query
SELECT *
FROM OPENQUERY (ADSI,
'SELECT co, whenCreated, whenChanged, sAMAccountName,objectGUID,sn, givenName, displayName, mail, telephoneNumber, mobile,
physicalDeliveryOfficeName, facsimileTelephoneNumber, title, department, company, manager, ipPhone, userAccountControl, badPwdCount
from ''LDAP://DC=domain,DC=com'' WHERE objectClass=''User''')
and insert in a Table that is defined like this
select Col1,Col2,Col3,Col4
from anotherTable
then your above Query should be written as
insert into AnotherTable
SELECT Col1,Col2,Col3,Col4
FROM OPENQUERY (ADSI,
'SELECT co, whenCreated, whenChanged, sAMAccountName,objectGUID,sn, givenName, displayName, mail, telephoneNumber, mobile,
physicalDeliveryOfficeName, facsimileTelephoneNumber, title, department, company, manager, ipPhone, userAccountControl, badPwdCount
from ''LDAP://DC=domain,DC=com'' WHERE objectClass=''User''')
Thank you for posting at Dotnetfunda
Vuyiswa Maseko
Thank you for posting at Dotnetfunda
[Administrator]
Sagarp, if this helps please login to Mark As Answer. | Alert Moderator