September 6, 2011 at 10:04 am
Many thanks in advance?
September 6, 2011 at 10:07 am
SQL ORACLE (9/6/2011)
Many thanks in advance?
by max character you mean the highest ASCII value? like 'A' = 65 and 'a' =97?
so the highest "char" in 'bananas' is 's' with an ascii of 115?
Lowell
September 6, 2011 at 10:13 am
I mean max number of characters in a text data type field.
September 6, 2011 at 10:15 am
you can use the LEN() or DATALENGTH() functions:
SELECT max(DATALENGTH(TheTextField)) As MaxDataLength FROM
TheTable
Lowell
September 6, 2011 at 10:20 am
It works. Many thanks again.
September 6, 2011 at 12:20 pm
fyi, the text and ntext datatypes are deprecated. You should instead use varchar(max) or nvarchar(max).
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
Viewing 6 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy