Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
PriyaJha
Helper I
Helper I

Best practice for joining tables of different warehouses with different collation

Hi,

 

I am trying to join tables of different warehouses present on same server but with different collation property and getting the follwoing error:

CollationIssue.png

 

What are the best practices to perform join between tables present in different warehouses but same server with different collation property?

1 ACCEPTED SOLUTION
NandanHegde
Super User
Super User

Please refer this thread :

https://stackoverflow.com/questions/20544392/how-to-fix-a-collation-conflict-in-a-sql-server-query




----------------------------------------------------------------------------------------------
Nandan Hegde (MSFT Data MVP)
LinkedIn Profile : www.linkedin.com/in/nandan-hegde-4a195a66
GitHUB Profile : https://github.com/NandanHegde15
Twitter Profile : @nandan_hegde15
MSFT MVP Profile : https://mvp.microsoft.com/en-US/MVP/profile/8977819f-95fb-ed11-8f6d-000d3a560942
Topmate : https://topmate.io/nandan_hegde
Blog :https://datasharkx.wordpress.com

View solution in original post

3 REPLIES 3
v-pnaroju-msft
Community Support
Community Support

Hi PriyaJha,

We have not received a response from you regarding the query and were following up to check if you have found a resolution. If you have identified a solution, we kindly request you to share it with the community, as it may be helpful to others facing a similar issue.

 

If you find the response helpful, please mark it as the accepted solution and provide kudos, as this will help other members with similar queries.

Thank you.

v-pnaroju-msft
Community Support
Community Support

Hi @PriyaJha,

 

Thank you for reaching out through the Microsoft Fabric Community Forum.

 

The error message indicates that there are two different collations in use. It is important to make them the same before performing a JOIN operation. This error occurs because the server mandates that collations for string comparisons, such as those in joins, must be identical.

Below are some best practices to resolve this issue:

  1. Choose one of the existing collations or create a new one that suits both tables.

              Latin1_General_CI_AS – Case-insensitive and accent-sensitive.
              Latin1_General_BIN – Binary collation that treats strings based on byte values.
  2. Modify the SQL query to use the COLLATE clause and explicitly specify the same collation for both columns in the JOIN condition:

    SELECT * FROM Table1 t1  JOIN Table2 t2  ON t1.ColumnName COLLATE  Latin1_General_CI_AS  = t2.ColumnName COLLATE  Latin1_General_CI_AS;

  3. If you need to permanently change the collation for a specific column, run the following query:

    ALTER TABLE Table1

    ALTER COLUMN ColumnName VARCHAR(255) COLLATE Latin1_General_CI_AS;
    This action may affect existing data and other related operations, so be careful while proceeding.

  4. Run the adjusted query to verify that the collation conflict has been resolved and that the JOIN operation executes successfully. Since collation changes can affect performance, it is advisable to test queries to ensure performance remains optimal after making these modifications.

    Also, please check these links for more information:

    COLLATE (Transact-SQL) - SQL Server | Microsoft Learn
    Collation and Unicode Support - SQL Server | Microsoft Learn

    If you find this response helpful, kindly mark it as the accepted solution and provide kudos. This will assist other community members facing similar queries.

    Thank you.


NandanHegde
Super User
Super User

Please refer this thread :

https://stackoverflow.com/questions/20544392/how-to-fix-a-collation-conflict-in-a-sql-server-query




----------------------------------------------------------------------------------------------
Nandan Hegde (MSFT Data MVP)
LinkedIn Profile : www.linkedin.com/in/nandan-hegde-4a195a66
GitHUB Profile : https://github.com/NandanHegde15
Twitter Profile : @nandan_hegde15
MSFT MVP Profile : https://mvp.microsoft.com/en-US/MVP/profile/8977819f-95fb-ed11-8f6d-000d3a560942
Topmate : https://topmate.io/nandan_hegde
Blog :https://datasharkx.wordpress.com

Helpful resources

Announcements
FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Fabric Update Carousel

Fabric Monthly Update - March 2026

Check out the March 2026 Fabric update to learn about new features.