首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法解决"Latin1_General_CI_AI“和"SQL_Latin1_General_CP1_CI_AS”之间的排序规则冲突

无法解决"Latin1_General_CI_AI“和"SQL_Latin1_General_CP1_CI_AS”之间的排序规则冲突
EN

Stack Overflow用户
提问于 2015-10-14 15:03:10
回答 3查看 161关注 0票数 0
代码语言:javascript
复制
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)
);
EN

回答 3

Stack Overflow用户

发布于 2015-10-14 15:12:09

代码语言:javascript
复制
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)
票数 1
EN

Stack Overflow用户

发布于 2015-10-14 15:05:33

您必须在比较中强制两个排序规则中的一个

票数 0
EN

Stack Overflow用户

发布于 2015-10-14 15:11:32

代码语言:javascript
复制
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)
)
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/33118701

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档