I have a SQL query that compares a value in the database to a constant:
SELECT * FROM my_table INNER JOIN #TempTable tem ON my_table.id = temp.id AND
The problem is the temp table. It uses the collation of the tempdb.
You could create a table in your actual db and not a temp table and then they would have the same collation. Or specify collation upon creating temp table.