sql text field

Marcel Kunath kunathma@pilot.msu.edu
Thu, 30 Nov 2000 09:17:31 -0500 (EST)


Thanks for the reply. You made me solve it. I have to say though:

    select max(len(convert(char(255),LibraryRequests))) from courserequest

does NOT solve this because it converts the text field to chars and the maximum
will always be the 255. It returned 255.

    select len(max(convert(char(255),LibraryRequests))) from courserequest

WILL get the longest entry (up to 255). In my case it returned 66.

thanks again.

 >
> Marcel,
>
> Try this:
>
> select max(len(convert(char(255),LibraryRequests)))) from courserequest
>
> This worked fine with MS SQL Server (yes, I work in a MS shop) and I would ass
ume
> that MAX works with other DBMAs, as well.
>
> Jeff
>
>
>
> Marcel Kunath wrote:
>
> > Hi,
> >
> > on sql server I got bunch of databases and in tables there are text fields.
I
> > need to find the maximum content in the fields.
> >
> >   select (len(convert(char(255),LibraryRequests))) from courserequest
> >
> > gives me the length of each entry up to 255 characters. I could then save th
e
> > output in a file and scan each line and get that way the largest entry in
> > length. Is there any other way to do it?
> >
> >   select max(len(convert(char(255),LibraryRequests))) from courserequest
> >
> > won't do it because it automatically goes for the 255 chars.
> >
> >  -- Marcel
> > _______________________________________________
> > linux-user mailing list
> > linux-user@egr.msu.edu
> > http://www.egr.msu.edu/mailman/listinfo/linux-user
>
>


--
Marcel Kunath

*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

 Montie House Network            Greater Lansing Linux Users Group
  http://www.montiehouse.com      http://www.gllug.org

*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*