Link to home
Start Free TrialLog in
Avatar of jakekula
jakekula

asked on

Sort ntext

Hi,

I am using SQL CE 2.0 and have an ntext field which I need to sort.  Due to integration issues, unfortunately ntext is all I am allowed to use.  I am having difficulty sorting it though... when I use:

SELECT * FROM ...some table... ORDER BY ...something...

I get an error, and when I looked on the net, aparently ntext cant be sorted.   Does anyone know of a solution to this...?

Thanks guys.
ASKER CERTIFIED SOLUTION
Avatar of ram2098
ram2098

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ram2098
ram2098

Another work around for this...

You can copy this data to a temporary table where you actually declare this column as varchar and sort it based on the column..

or else

select * from testtest order by convert(varchar(2000),test2) --in the order by ..do an explicit conversion as I shown in the query
Try this:

SELECT * FROM ...some table... ORDER BY cast(something as nvarchar(4000))