Home > Archive > MS SQL Server > October 2006 > Selecting ntext from Excel using SQL









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Selecting ntext from Excel using SQL
ola.alaa@gmail.com

2006-10-24, 6:38 pm

i used openquey to select data from Excel or Access files, but i faced
one problem when i select a field with ntext datatype, i can't use
"Select Distinct" or "Oreder by" with "ntext" datatype because it is
not comparable, it gives me this error msg "The text, ntext, and image
data types cannot be compared or sorted", is there a way to convert
ntext to varchar with limited length??

thanx in advance..
Ola

Arnie Rowland

2006-10-24, 6:38 pm

cast( ntextfield AS varchar(8000) )

--
Arnie Rowland, Ph.D.
Westwood Consulting, Inc

Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous


<ola.alaa@gmail.com> wrote in message
news:1161298705.316274.202920@i42g2000cwa.googlegroups.com...
>i used openquey to select data from Excel or Access files, but i faced
> one problem when i select a field with ntext datatype, i can't use
> "Select Distinct" or "Oreder by" with "ntext" datatype because it is
> not comparable, it gives me this error msg "The text, ntext, and image
> data types cannot be compared or sorted", is there a way to convert
> ntext to varchar with limited length??
>
> thanx in advance..
> Ola
>



amish

2006-10-24, 6:38 pm


Arnie Rowland wrote:
[color=darkred]
> cast( ntextfield AS varchar(8000) )
>
> --
> Arnie Rowland, Ph.D.
> Westwood Consulting, Inc
>
> Most good judgment comes from experience.
> Most experience comes from bad judgment.
> - Anonymous
>
>
> <ola.alaa@gmail.com> wrote in message
> news:1161298705.316274.202920@i42g2000cwa.googlegroups.com...

In SQL Server 2005 you can use varchar(max) or nvarchar(max) instead
text or ntext, which doesn't have this limitations.

Regards
Amish Shah
http://shahamishm.tripod.com

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com