← Back to Knowledge Base

KB #240034: Error – Cannot resolve collation conflict for concatenation operation

⏱️ 2 min read

Type:

Fix

Summary:

When encrypting or decrypting a column when using a non-Western version of SQL Server, you may receive an error similar to the following:

  Server: Msg 446, Level 16
  Cannot resolve collation conflict for concatenation operation.

Important: this can potentially lead to corruption of the data in the column

Additional Information:

Encryptionizer installs the UDFs in Master. If the Collation Value of the target database does not match the Collation Value of Master, SQL Server may become confused when trying to encrypt or decrypt a column or variable using one of the fn_n_encrypt_ or fn_n_decrypt_ functions.The solution is to install the UDFs in the database which contains the columns being encrypted. In fact, we recommend this solution even if the collation values do match.

To install and use the UDFs in the target database, modify ADD_UDF_XP.SQL and comment out the following line:

   USE MASTER

Then use Query Analyzer to run ADD_UDF_XP.SQL in the desired database.Finally, modify any function calls to refer to the current database, rather than Master. For example, change:

  update customer set CreditCard = 
       master.dbo.fn_n_encrypt_char(@cc,0,0,1)

– to –

  update customer set CreditCard = 
       dbo.fn_n_encrypt_char(@cc,0,0,1)

Tip:The Collation Name can be found in Enterprise Manager under the Database Properties (right click on database name).

The Collation Name can be found in Query Analyzer by querying the ‘collation’ property with DatabasePropertyEx. E.g.,

   select DatabasePropertyEx('Northwind','collation')

Related Topics:

240028: How to Install APIs Manually

Was this article helpful?

Related Articles

KB #240157: How to transfer an Encryptionizer Distribution license from one machine to another (v2201.1.0 and later)

Type: Information Summary: You are upgrading or otherwise need to migrate an installation of Encryptionizer…

KB #240105: How to transfer an Encryptionizer license from one machine to another (Build 2019.1210.31152 or earlier)

Type: Information Summary: You are upgrading a machine or otherwise need to move an installation…

KB #240153: NetLib Encryptionizer Modules and Endpoint Protection

Type: Information Summary: If Endpoint protection flags one of our modules, we recommend whitelisting our…

Still need help?

Our support team is here to assist you.

NetLib Security
AI Assistant · Online
Hi! I'm the NetLib Security assistant. I can answer questions about our encryption solutions, HIPAA compliance, Encryptionizer, and more. How can I help you today?