collation trouble with big int

  • Hi

    i am getting :Cannot resolve the collation conflict between "Latin1_General_BIN" and "Latin1_General_CI_AS" in the equal to operation.

    ...for the below....

    select *

    from dbo.CustStockFact t1

    join (select * from dbo.vw_CustStockSalesHistory where TrnYear = year(getdate()) ) t2

    on t1.TimeKey = t2.TimeKey

    and t1.Customer = t2.Customer

    and t1.StockCode = t2.StockCode

    I've tried....

    select *

    from dbo.CustStockFact t1

    join (select * from dbo.vw_CustStockSalesHistory where TrnYear = year(getdate()) ) t2

    on t1.TimeKey COLLATE Latin1_General_CI_AS = t2.TimeKey COLLATE Latin1_General_CI_AS

    and t1.Customer COLLATE Latin1_General_CI_AS = t2.Customer COLLATE Latin1_General_CI_AS

    and t1.StockCode COLLATE Latin1_General_CI_AS = t2.StockCode COLLATE Latin1_General_CI_AS

    ..but i'm getting this error : Expression type bigint is invalid for COLLATE clause.

    My TimeKey is a bigint type.

    Can anyone advise. Thanks

  • Collate is relevant for strings, not numerics. You need to remove it from the bigint.

    The absence of evidence is not evidence of absence.
    Martin Rees

    You can lead a horse to water, but a pencil must be lead.
    Stan Laurel

  • ahh i see, that worked great, thanks

  • Thank you so much you solved my problem.

    I have written COLLATE DATABASE_DEFAULT everywhere, where i use "where" clause in my procedure.

    After reading your article i just remove COLLATE DATABASE_DEFAULT from column with bigint as datatype and my issue was solved.

    thank you so much once again.:cool:

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply