这是我的SQL查询
DELETE FROM [Prospects].[dbo].[P1]
WHERE RTRIM(LTRIM(DomainName)) IN
(SELECT RIGHT(UserEmail, LEN(UserEmail) - CHARINDEX('@', UserEmail)) UserEmail
FROM [Recruiter].[dbo].[tblSystemUser])
如何解决这个问题?
答案 0 :(得分:2)
您可以添加
COLLATE DATABASE_DEFAULT
到查询结束时将其转换并修复错误,但这会影响性能。
正如jarlh所建议的那样,将数据库的整理更改为相同的实际修复。
答案 1 :(得分:0)
尝试将COLLATE DATABASE_DEFAULT添加到您的查询中:
DELETE FROM [Prospects].[dbo].[P1]
WHERE RTRIM(LTRIM(DomainName)) COLLATE DATABASE_DEFAULT IN
(SELECT RIGHT(UserEmail, LEN(UserEmail) - CHARINDEX('@', UserEmail)) COLLATE DATABASE_DEFAULT UserEmail
FROM [Recruiter].[dbo].[tblSystemUser])
答案 2 :(得分:-1)
试试吧
DELETE FROM [Prospects].[dbo].[P1]
WHERE RTRIM(LTRIM(DomainName)) COLLATE DATABASE_DEFAULT IN
(SELECT RIGHT(UserEmail, LEN(UserEmail) - CHARINDEX('@', UserEmail)) UserEmail
FROM [Recruiter].[dbo].[tblSystemUser
])