Tuesday, September 6, 2011

SQL SERVER – Cannot resolve collation conflict for equal to operation

select * from tab1 a, tab2 b where a.id = b.id

If "id" in tab1 and tab2 have different collation. will have error "Cannot resolve collation conflict for equal to operation".

Fix:

select * from tab1 a, tab2 b where a.id  COLLATE DATABASE_DEFAULT = b.id. COLLATE DATABASE_DEFAULT

No comments: