collation Urgent

  • Hi

     

    I have a database operating with another collation than the SQL Server collation that was set during installation.

    In my database I declare the following table (and need to do it in this way)

    declare @UserSegment table (UserID varchar(20), SegmentID varchar(20))

    When I later on are using this @UserSegment variable in a join against another table and field with another collation than "database default collation" I get a collation conflict...

    So, my question is how I can change the collation for the table I have declared as my @UserSegment variable ?

     

    I have tried with

     declare @UserSegment table (UserID varchar(20), SegmentID varchar(20)) COLLATE Latin1_General_CI_AS

     

    but obvisously it doesnt work....just get the message "Incorrect syntax near the keyword 'COLLATE'."

     

    Can someone please help me solve this I would be greatful..

     

    Cheers

    Helmut

  • Each column has it's collation set individually so try:

    declare @UserSegment table (UserID varchar(20) COLLATE Latin1_General_CI_AS, SegmentID varchar(20) COLLATE Latin1_General_CI_AS)

    Just tried it in QA... works good as!

    Taa,

    B

Viewing 2 posts - 1 through 1 (of 1 total)

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