" Thai_CI_AS"之间的SQL查询冲突和" SQL_Latin1_General_CP1_CI_AS"

时间:2017-04-27 04:31:47

标签: sql sql-server tsql collation

您好我知道这个查询有什么问题

SELECT [no]
--  into #mytemp
  FROM [pcb_comp]
  where no in (SELECT [no] FROM [Data_Query].[dbo].[query]
  where [no] NOT IN (select no from [IPTS2].[dbo].[abc]))
  and location = 'PCB'
  order by no 

1 个答案:

答案 0 :(得分:0)

如果与位置列的排序规则冲突出现问题,请使用以下方法:

SELECT [no]
--  into #mytemp
  FROM [pcb_comp]
  where no in (SELECT [no] FROM [Data_Query].[dbo].[query]
  where [no] NOT IN (select no from [IPTS2].[dbo].[abc]))
  and location COLLATE DATABASE_DEFAULT = 'PCB' COLLATE DATABASE_DEFAULT
  order by no

同样适用于您的' in'如果上面的过滤器不起作用。