Problem with Comparison of CLR type
Wyatt70
Posts: 50
SQL Server Version: 9.0.3054
SQL Data Compare Version: 6.0.0.1124
I am attempting to compare two databases, each of which has several tables with a column whose data type is a CLR data type. The comparison engine is able to process some of the tables using this type, but is not able to process other tables using this type.
Here is the error message: The type "UserInformation" is not comparable. It cannot be used in the ORDER BY clause.
The problem gets a little more interesting when you consider the history of these tables. In an earlier attempt at synchronization, I dropped and recreated the columns using the CLR type for some of the tables. All of the columns for which I dropped and recreated the column were able to be compared. However, I was also able to compare one of the tables for which I made no modifications.
The CLR type is used to store information on the user who originally populated the column, and the user who made the most recent data update to the column.
Here is an example of the data stored in the column:
Nothing fancy, just a datetime value and a character string.
Any ideas on why SQL Data compare is choking on this?
SQL Data Compare Version: 6.0.0.1124
I am attempting to compare two databases, each of which has several tables with a column whose data type is a CLR data type. The comparison engine is able to process some of the tables using this type, but is not able to process other tables using this type.
Here is the error message: The type "UserInformation" is not comparable. It cannot be used in the ORDER BY clause.
The problem gets a little more interesting when you consider the history of these tables. In an earlier attempt at synchronization, I dropped and recreated the columns using the CLR type for some of the tables. All of the columns for which I dropped and recreated the column were able to be compared. However, I was also able to compare one of the tables for which I made no modifications.
The CLR type is used to store information on the user who originally populated the column, and the user who made the most recent data update to the column.
Here is an example of the data stored in the column:
Created On: 1/22/2008 12:00:00 AM,Created By: KEPOWERS,Modified On: 1/22/2008 12:00:00 AM,Modified By: KEPOWERS
Nothing fancy, just a datetime value and a character string.
Any ideas on why SQL Data compare is choking on this?
Comments
Perhaps you could try setting the 'transport clr types as binary' option in the project settings to see if that makes a difference.
The other thing is to run a SQL Profiler trace when you're comparing the tables to see what command SQL Data Compare uses when reading the table to see if that works in SQL Management Studio or something. It should be something like...
Project Manager
Red Gate Software Ltd
I wonder if selecting the CLR type as part of the comparison key is what is causing the issue - in the tables that work is the CLR type part of the comparison key or not?
Project Manager
Red Gate Software Ltd
If you exclude the CLR data type from the custom comparison key it should work as long as you don't rely on that field being part of your 'uniqueness' constraint. Otherwise you'll have to implement IComparable for your type.
HTH
Project Manager
Red Gate Software Ltd