• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1368
  • Last Modified:

Max Character For String Parameter in SQL

I have this problem. I have designed a table to store long message or remark, where these info are more than 1000 characters. When I use store procedures to assign these info into a parameter/variable (where I declared it as @str varchar(1000)), it's only return first 250 characters of remark or message? The rest of the characters are all truncated. WHy? Pls help me. Thanks in advance.

1 Solution
Are you looking at this through query analyzer?  If you look under the options in query analyzer in the results tab you will see a maximum numbers of charcters per column option that you can change to bring back more characters.
if the problem is when you are getting the details from the database then please check whether the full message is stored in the database.The text may be truncated in the front end. Please post some code, so that it will be easy for us to find the problem..
Ken SelviaRetiredCommented:
To see if you are really storing more than 250 characters;

select max(datalength(remark)) from mytable
Dishan FernandoSoftware Engineer / DBACommented:
Agree with curtis591

It should be settings in QA. You can use more than 1000 as a variable

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Build your data science skills into a career

Are you ready to take your data science career to the next step, or break into data science? With Springboard’s Data Science Career Track, you’ll master data science topics, have personalized career guidance, weekly calls with a data science expert, and a job guarantee.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now