Resolving “Cannot resolve collation conflict for equal to operation”

I recently had to run a query for one of our developers where the script was inserting a number of rows. All went well in the US and JP business locations, but then ran into this error on the UK server: “Cannot resolve collation conflict for equal to operation”.

After searching a bit, I found this example that resolved the issue. Below is an example of the script that threw the error:

I resolved the error by adding the following to the script. Note the “COLLATE DATABASE_DEFAULT” and their locations:

For a MERGE statement, add it to the end of the ON statement:

Views – 2329