Friday, March 9, 2012

How Alter text column length?

How can I change the length of a Data Type text column? All I've found in BO
L
is that you can't do it!
Thanks -Can you be more specific? Text can hold up to 2GB data, and you do not speci
fy that length, as you
do with varchar.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Bil Click" <BilClick@.discussions.microsoft.com> wrote in message
news:691FEB50-310C-4DB5-91B2-D28822BA252B@.microsoft.com...
> How can I change the length of a Data Type text column? All I've found in
BOL
> is that you can't do it!
> Thanks -|||Tibor, Looks like Bil needs to see the entire contents of text column while
querying (SELECT).
Bil,
See the command SET TEXTSIZE in books online.
Thanks
Hari
SQL Server MVP
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:Oq2JDiSmFHA.2860@.TK2MSFTNGP15.phx.gbl...
> Can you be more specific? Text can hold up to 2GB data, and you do not
> specify that length, as you do with varchar.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Bil Click" <BilClick@.discussions.microsoft.com> wrote in message
> news:691FEB50-310C-4DB5-91B2-D28822BA252B@.microsoft.com...
>|||The column was created with Length = 16. I am trying to store a text stream
which is being truncated at aprox 88 characters. Sample:
<BR>*** TOP OF REPORT ***<BR> NORTH CAROLINA DIVISION OF
MOTOR VEHICLES<BR>  
I don't get the correlation between 16 and 88, if I am counting those chars
correctly.
OBJECTPROPERTY TableTextInRowLimit = 0 indicates text in row option is not
set.
- Bil Click
"Tibor Karaszi" wrote:

> Can you be more specific? Text can hold up to 2GB data, and you do not spe
cify that length, as you
> do with varchar.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Bil Click" <BilClick@.discussions.microsoft.com> wrote in message
> news:691FEB50-310C-4DB5-91B2-D28822BA252B@.microsoft.com...
>|||The length16 is just Enterprise Manager's rather stupid way to tell you that
the pointer used in the
internal handling of the text datatype is 16 bytes. It has nothing to do wit
h what you can actually
store (which is 2GB, nothing that you configure in any way). The truncation
either happens at input
or output of the data. Try checking the length using the DATALENGTH function
.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Bil Click" <BilClick@.discussions.microsoft.com> wrote in message
news:57F1B4D3-9B8B-43F4-BDB9-F5D2057AEFD2@.microsoft.com...[vbcol=seagreen]
> The column was created with Length = 16. I am trying to store a text strea
m
> which is being truncated at aprox 88 characters. Sample:
> <BR>*** TOP OF REPORT ***<BR> NORTH CAROLINA DIVISION O
F MOTOR VEHICLES<BR>
>  
> I don't get the correlation between 16 and 88, if I am counting those char
s
> correctly.
> OBJECTPROPERTY TableTextInRowLimit = 0 indicates text in row option is no
t
> set.
> - Bil Click
>
> "Tibor Karaszi" wrote:
>|||Turns out to be a Query Analyzer "gotcha", truncated the displayed field.
When I used the Datalength function I could see there really was more data
than being displayed in QA. EM only says <Long Text>. I finally opeded up
osql and see that the full text is being stored.
Thanks for the tips! Cheers!
- Bil
"Tibor Karaszi" wrote:

> The length16 is just Enterprise Manager's rather stupid way to tell you th
at the pointer used in the
> internal handling of the text datatype is 16 bytes. It has nothing to do w
ith what you can actually
> store (which is 2GB, nothing that you configure in any way). The truncatio
n either happens at input
> or output of the data. Try checking the length using the DATALENGTH functi
on.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Bil Click" <BilClick@.discussions.microsoft.com> wrote in message
> news:57F1B4D3-9B8B-43F4-BDB9-F5D2057AEFD2@.microsoft.com...
>

No comments:

Post a Comment