SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 How to filter the NULL values in LDAP
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

gangadhara.ms
Aged Yak Warrior

India
547 Posts

Posted - 12/05/2012 :  03:02:35  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

India
2218 Posts

Posted - 12/05/2012 :  03:40:32  Show Profile  Reply with Quote
Post the error message.

--
Chandu
Go to Top of Page

gangadhara.ms
Aged Yak Warrior

India
547 Posts

Posted - 12/05/2012 :  04:08:31  Show Profile  Reply with Quote
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

Russia
1 Posts

Posted - 09/01/2014 :  23:26:16  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000