The following code:
SELECT *
FROM portal.workflow AS w
INNER JOIN portal.workflow_type AS wt
ON w.workflow_type_id = wt.workflow_type_id
WHERE wt.doc_type IN ('CentreEV', 'Expenditure Voucher')
AND w.varchar_1 NOT IN ( select f1.BAT_NAME as 'DocumentFile'
from openquery(QICRE_F1, 'select *
from dbo.IO_GLF_BAT_CTL_VW
where bat_stat = ''S'' ') f1
where f1.USAGE_STAT = 'A' )
Is throwing the following error:
Msg 468, Level 16, State 9, Line 1 Cannot resolve the collation conflict between "Latin1_General_CI_AS" and "Latin1_General_CS_AS" in the equal to operation.
I've tried to fix this with the following, but I'm receiving a syntax error. I'm at a loss (even after looking at documention) how this should be done in this instance:
SELECT *
FROM portal.workflow AS w
INNER JOIN portal.workflow_type AS wt
ON w.workflow_type_id = wt.workflow_type_id
WHERE wt.doc_type IN ('CentreEV', 'Expenditure Voucher')
AND COLLATE Latin1_General_CI_AS w.varchar_1 NOT IN
( select f1.BAT_NAME as 'DocumentFile'
from openquery(QICRE_F1, 'select *
from dbo.IO_GLF_BAT_CTL_VW
where bat_stat = ''S'' ') f1
where f1.USAGE_STAT = 'A' )