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)
 Cannot resolve the collation conflict

Author  Topic 

mchohan
Starting Member

39 Posts

Posted - 2010-08-25 : 09:55:14
Hi
Can somone tell me where to put the collate keyword? I keep getting the following error:

Msg 468, Level 16, State 9, Line 1
Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Latin1_General_CI_AS" in the equal to operation.

SELECT distinguishedName[dn],samAccountName[adusername], givenname[fname] ,sn[sname]
FROM OPENQUERY (ADSI,'SELECT distinguishedName,samAccountName, givenName, sn FROM ''LDAP://dc=[],dc=[]'' WHERE objectClass=''Person'' AND objectClass = ''User''')
WHERE samAccountName not in (Select adusername From Users)
and (givenName is not null AND sn is not null)

Thanks.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-08-25 : 09:58:34
use COLLATE SQL_Latin1_General_CP1_CI_AS on both ends of comparison

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -