DataBase/SQL Server
Cannot resolve the collation conflict
탑~!
2013. 10. 23. 10:55
데이터 정렬 리스트
SELECT * FROM fn_helpcollations()
GO
<<데이터베이스
ALTER DATABASE 디비명
COLLATE Japanese_CI_AS
GO
EXEC sp_helpdb '디비명'
GO
<<테이블
alter table 테이블명
alter column 컬럼명 데이터형식 collate Japanese_CI_AS
에러예시>>
Cannot resolve the collation conflict between "Japanese_Unicode_CI_AI" and "Japanese_CI_AS" in the equal to operation.

문자열 비교 시 다음과 같은 에러가 발생하는 경우가 있다.
Cannot resolve the collation conflict between "Chinese_PRC_CI_AS" and "SQL_Latinl_General_CPl_CI_AS" in the not equal to opration.
WHERE 절에 COLLATTE DATABASE_DEFAULT를 명시적으로 붙여줘서 해결한다.
SELECT ID
FROM ItemsTable
INNER JOIN AccountsTable
WHERE ItemsTable.Collation1Col = AccountsTable.Collation2Col
SELECT ID
FROM ItemsTable
INNER JOIN AccountsTable
WHERE ItemsTable.Collation1Col COLLATE DATABASE_DEFAULT
= AccountsTable.Collation2Col COLLATE DATABASE_DEFAULT
728x90
반응형