If you create a Stored Procedure or View which does a Union where one part of the union has a text field – referred to having a Deltek data type of “memo” [ Configuration | User Defined Tabs (Fields tab) ] which is labeled as “text” in SQL. You may get the following error message: ‘The text data type cannot be selected as DISTINCT because it is not comparable’
If you cast the text (memo) field as ‘nvarchar(max)’ this will correct the error.
Select Cast(oldField as nvarchar(max)) as oldFieldName …