Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SELECT PROBLEM VARCHAR(MAX)

Author  Topic 

amodi
Yak Posting Veteran

83 Posts

Posted - 2009-06-23 : 04:46:57
Hello Friends,
I have table named 'abc' and a column named 'content' column's datatype is varchar(max). I inserted a value in the table. Inserted value for the column 'content' is as follows:

"These policies assist us to work in a professional and systematic approach and are laid down for the security and benefit of everyone. We know that most people want to work, courteously, efficiently, honestly, and we feel this handbook will guide you properly in that direction and we hope that it will enlighten you more about our company. Although a thorough familiarity with the contents of this document can be very helpful, remember that in many issues concerning your employment, no written document can be more effective than direct communication with your supervisors or with a representative from the Human Resources Department (HRD). "

But when i select the value using 'SELECT' statement as :
SELECT CONTENT FROM ABC

I am not getting the complete value as follows:

These policies assist us to work in a professional and systematic approach and are laid down for the security and benefit of everyone.
We know that most people want to work, courteously, efficiently, honestly, and we feel this handbook will guide you prope


Why i am not getting the full value, Is there something wrong with the query.

Thanks.

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-06-23 : 04:55:13
If you do this is SSMS, the text is truncated after default 255 characters.
Goto Tools -> Options to set another value for SSMS to display.


E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

amodi
Yak Posting Veteran

83 Posts

Posted - 2009-06-23 : 07:32:57
quote:
Originally posted by Peso

If you do this is SSMS, the text is truncated after default 255 characters.
Goto Tools -> Options to set another value for SSMS to display.


E 12°55'05.63"
N 56°04'39.26"




1. Is it OK to set it to 2000 or 3000 characters?
2. Do we have some option like max?
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-06-23 : 08:30:14
What happened when you tried?


E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

amodi
Yak Posting Veteran

83 Posts

Posted - 2009-06-23 : 09:34:17
quote:
Originally posted by amodi

quote:
Originally posted by Peso

If you do this is SSMS, the text is truncated after default 255 characters.
Goto Tools -> Options to set another value for SSMS to display.


E 12°55'05.63"
N 56°04'39.26"




1. Is it OK to set it to 2000 or 3000 characters?
2. Do we have some option like max?



Thanks peso. Its working fine. I just wanted to know why characters are limited to 255?( performance issue )

1. Do we have options like max or auto.
Go to Top of Page
   

- Advertisement -