Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 How to filter the NULL values in LDAP

Author  Topic 

gangadhara.ms
Aged Yak Warrior

549 Posts

Posted - 2012-12-05 : 03:02:35
Hi,
I am using the below query to fetch records from LDAP server

SELECT * FROM OpenQuery(ADSI, 'SELECT uid,MSUsername,DisplayName,mail
FROM ''LDAP://aaa.xxx.com''
where objectClass = ''Person'' AND MSUsername = ''pmelody*'' ')

Here i want to include the condition for another where clause for NULL

SELECT * FROM OpenQuery(ADD, 'SELECT uid,MSUsername,DisplayName,mail
FROM ''LDAP://aaa.xxx.com''
where objectClass = ''Person'' AND MAIL is null AND MSUsername = ''pmelody*'' ')

Its giving up with an error pls help.



Thanks,
Gangadhara MS
SQL Developer and DBA

bandi
Master Smack Fu Yak Hacker

2242 Posts

Posted - 2012-12-05 : 03:40:32
Post the error message.

--
Chandu
Go to Top of Page

gangadhara.ms
Aged Yak Warrior

549 Posts

Posted - 2012-12-05 : 04:08:31
i got the solution but putting this condition mail="*" its worked for me.

Thanks,
Gangadhara MS
SQL Developer and DBA
Go to Top of Page

mike.a
Starting Member

1 Post

Posted - 2014-09-01 : 23:26:16
quote:
Originally posted by gangadhara.ms

i got the solution but putting this condition mail="*" its worked for me.



thank you man, it really works. but i had to use single quotes like mail='*'
maybe implementation matters. it was W2K8 AD
Go to Top of Page
   

- Advertisement -