Showing posts with label enter. Show all posts
Showing posts with label enter. Show all posts

Tuesday, March 20, 2012

pulling ntext values sql server 2005

hi,
i have a column of type ntext in the db, we're using that to allow
users to store essays they can enter. problem is when i'm running a
select on the ntext column, data seems to be getting cut off, isn't
ntext suppose to hold a lot of data, we wanted to allow them in a min
of 1500 chars, while everytime i do a
select len(max (convert(nvarchar(2000), essaytext)))

just to see the max we one had it's always 200.

Thanks.
"phil2phil" <philtwophil@.yahoo.comwrote in message
news:1173714656.510142.22770@.v33g2000cwv.googlegro ups.com...

Quote:

Originally Posted by

hi,
i have a column of type ntext in the db, we're using that to allow
users to store essays they can enter. problem is when i'm running a
select on the ntext column, data seems to be getting cut off, isn't
ntext suppose to hold a lot of data, we wanted to allow them in a min
of 1500 chars, while everytime i do a
select len(max (convert(nvarchar(2000), essaytext)))
>
just to see the max we one had it's always 200.
>
Thanks.
>


What tool are you using for this? If it's QA, you can adjust what it returns
via a setting.

--
Greg Moore
SQL Server DBA Consulting
Email: sql (at) greenms.com http://www.greenms.com|||Hi,
I've tried both Sql sever 2000 QA and Sql server 2005 Management
Studio. For QA i set the Results Max chars to 8192 and in Management
studio i set the max chars per column for Text Retults to 8192 and for
Grid to Non XML 65535, but it's still not returning the full, and each
max length is always 200.

On Mar 12, 12:11 pm, "Greg D. Moore \(Strider\)"
<mooregr_deletet...@.greenms.comwrote:

Quote:

Originally Posted by

"phil2phil" <philtwop...@.yahoo.comwrote in message
>
news:1173714656.510142.22770@.v33g2000cwv.googlegro ups.com...
>

Quote:

Originally Posted by

hi,
i have a column of type ntext in the db, we're using that to allow
users to store essays they can enter. problem is when i'm running a
select on the ntext column, data seems to be getting cut off, isn't
ntext suppose to hold a lot of data, we wanted to allow them in a min
of 1500 chars, while everytime i do a
select len(max (convert(nvarchar(2000), essaytext)))


>

Quote:

Originally Posted by

just to see the max we one had it's always 200.


>

Quote:

Originally Posted by

Thanks.


>
What tool are you using for this? If it's QA, you can adjust what it returns
via a setting.
>
--
Greg Moore
SQL Server DBA Consulting
Email: sql (at) greenms.com http://www.greenms.com

|||I think i found it, the stored proc doing the actual insert into the
table, was set to @.ESSAYTEXT varchar(200) for that column, we decided
to restrict it to 2000 chars, so changing it to @.ESSAYTEXT
varchar(2000), hopefully that's fix it, the varchar(200) explains the
max(len issue as well.

On Mar 12, 12:26 pm, "phil2phil" <philtwop...@.yahoo.comwrote:

Quote:

Originally Posted by

Hi,
I've tried both Sql sever 2000 QA and Sql server 2005 Management
Studio. For QA i set the Results Max chars to 8192 and in Management
studio i set the max chars per column for Text Retults to 8192 and for
Grid to Non XML 65535, but it's still not returning the full, and each
max length is always 200.
>
On Mar 12, 12:11 pm, "Greg D. Moore \(Strider\)"
>
<mooregr_deletet...@.greenms.comwrote:

Quote:

Originally Posted by

"phil2phil" <philtwop...@.yahoo.comwrote in message


>

Quote:

Originally Posted by

news:1173714656.510142.22770@.v33g2000cwv.googlegro ups.com...


>

Quote:

Originally Posted by

Quote:

Originally Posted by

hi,
i have a column of type ntext in the db, we're using that to allow
users to store essays they can enter. problem is when i'm running a
select on the ntext column, data seems to be getting cut off, isn't
ntext suppose to hold a lot of data, we wanted to allow them in a min
of 1500 chars, while everytime i do a
select len(max (convert(nvarchar(2000), essaytext)))


>

Quote:

Originally Posted by

Quote:

Originally Posted by

just to see the max we one had it's always 200.


>

Quote:

Originally Posted by

Quote:

Originally Posted by

Thanks.


>

Quote:

Originally Posted by

What tool are you using for this? If it's QA, you can adjust what it returns
via a setting.


>

Quote:

Originally Posted by

--
Greg Moore
SQL Server DBA Consulting
Email: sql (at) greenms.com http://www.greenms.com

|||
"phil2phil" <philtwophil@.yahoo.comwrote in message
news:1173717649.377685.103280@.h3g2000cwc.googlegro ups.com...

Quote:

Originally Posted by

>I think i found it, the stored proc doing the actual insert into the
table, was set to @.ESSAYTEXT varchar(200) for that column, we decided
to restrict it to 2000 chars, so changing it to @.ESSAYTEXT
varchar(2000), hopefully that's fix it, the varchar(200) explains the
max(len issue as well.
>


Yeah.. if you're only inserting 200.. ;-)

(note that text fields sometimes are better handled with readtext/writetext.

But if you're moving to SQL 2005 any time I'd highly recommend varchar(max)

--
Greg Moore
SQL Server DBA Consulting
Email: sql (at) greenms.com http://www.greenms.com