Home > Archive > MS SQL Server > March 2005 > Len() on a data type text field









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 Len() on a data type text field
Ben Bleser

2005-03-31, 8:01 pm

I'm trying to do a len() function on a text field in SQl
Server 2000. Of course this doesn't work but is there a
another way to do this?

Thanks,
Ben Bleser
Marco Pais

2005-03-31, 8:01 pm

The LEN() function should work in SQL Server 2000. Why can't you use it?


"Ben Bleser" < anonymous@discussion
s.microsoft.com> wrote in message
news:11d101c5360c$99
251960$a601280a@phx.gbl...
> I'm trying to do a len() function on a text field in SQl
> Server 2000. Of course this doesn't work but is there a
> another way to do this?
>
> Thanks,
> Ben Bleser



Lars Broberg

2005-03-31, 8:01 pm

Ben,
Try DataLength(column)
Lars Broberg
Elbe-Data AB
http://www.elbe-data.se
Remove "nothing." when replying to private e-mail!


Ben Bleser wrote:
> I'm trying to do a len() function on a text field in SQl
> Server 2000. Of course this doesn't work but is there a
> another way to do this?
>
> Thanks,
> Ben Bleser

Jack

2005-03-31, 8:01 pm

DATALENGTH()

"Ben Bleser" wrote:

> I'm trying to do a len() function on a text field in SQl
> Server 2000. Of course this doesn't work but is there a
> another way to do this?
>
> Thanks,
> Ben Bleser
>

Tibor Karaszi

2005-03-31, 8:01 pm

DATALENGTH()
Should give the same as LEN() would have for text datatype.

--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www. solidqualitylearning
.com/

http://www.sqlug.se/


"Ben Bleser" < anonymous@discussion
s.microsoft.com> wrote in message
news:11d101c5360c$99
251960$a601280a@phx.gbl...
> I'm trying to do a len() function on a text field in SQl
> Server 2000. Of course this doesn't work but is there a
> another way to do this?
>
> Thanks,
> Ben Bleser



Aaron [SQL Server MVP]

2005-03-31, 8:01 pm

The datatype is TEXT. So, several string functions are not valid, including
LEN().

--
Please post DDL, sample data and desired results.
See http://www.aspfaq.com/5006 for info.




"Marco Pais" < mpaisIGNORE@foruminf
ormatica.pt> wrote in message
news:u#LOj2gNFHA.3336@TK2MSFTNGP09.phx.gbl...
> The LEN() function should work in SQL Server 2000. Why can't you use it?



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