簡體   English   中英

無法解決“ Latin1_General_CI_AI”和“ SQL_Latin1_General_CP1_CI_AS”之間的排序規則沖突

[英]Cannot resolve the collation conflict between “Latin1_General_CI_AI” and “SQL_Latin1_General_CP1_CI_AS”

insert into @temp_traffic_reports(id, assetname,datestamp,messagetype,itemquantity)
(
    select 
        tf.ID as id, 
        ta.TrackingIdentityName as assetname, 
        DATEADD(hour,@TimeZoneValue,Datestamp) as datestamp ,
        'Poll for position report' as messagetype,
        '1' as  itemquantity
FROM trackmaps_WHB.dbo.MESForwardMessage tf
join @temp_assets ta 
    on tf.TerminalID = ta.TrackingIndentity
where 
    Datestamp between DATEADD(hour,@TimeZoneValue,@fDate) and DATEADD(hour,@TimeZoneValue,@tDate)
);
insert into @temp_traffic_reports(id, assetname,datestamp,messagetype,itemquantity)
(
    select 
        tf.ID as id, 
        ta.TrackingIdentityName COLLATE SQL_Latin1_General_CP1_CI_AS as assetname , 
        DATEADD(hour,@TimeZoneValue,Datestamp) as datestamp ,
        'Poll for position report' as messagetype,
        '1' as  itemquantity
FROM trackmaps_WHB.dbo.MESForwardMessage tf
join @temp_assets ta 
    on tf.TerminalID = ta.TrackingIndentity
where 
    Datestamp between DATEADD(hour,@TimeZoneValue,@fDate) and DATEADD(hour,@TimeZoneValue,@tDate)

您必須強制比較中的兩個歸類之一

insert into @temp_traffic_reports(id, assetname,datestamp,messagetype,itemquantity)
(
    select 
        tf.ID as id, 
        ta.TrackingIdentityName as assetname, 
        DATEADD(hour,@TimeZoneValue,Datestamp) as DATES_STAMP ,
        'Poll for position report' as messagetype,
        '1' as  itemquantity
FROM trackmaps_WHB.dbo.MESForwardMessage tf
join @temp_assets ta 
    on tf.TerminalID = ta.TrackingIndentity
CROSS APPLY (SELECT DATES_STAMP) AS A
 WHERE A.DATES_STAMP between DATEADD(hour,@TimeZoneValue,@fDate) and DATEADD(hour,@TimeZoneValue,@tDate)
)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM