Solved

varchar variable getting truncated to 256 chars!

Posted on 2002-07-08
6
548 Views
Last Modified: 2008-07-03
DECLARE @sql varchar(2000)

this is a delcaration of a variable in sql server procedure. along with some query some more values are getting added to this variable through a loop. But this is getting truncated to 256 chars [and not generating any errors]
Any one knows why it is getting truncated?
0
Comment
Question by:sanjaykattimani
  • 4
  • 2
6 Comments
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 100 total points
ID: 7137460
2 things:
* do you mean that the output in Query Analyser get's truncated?
-> see in the options of query analyser, you have an parameter saying max caracters per column, which is 256 by default. You could increase this value to see more...

* is the compatibility of the database eventually set to version 6?
->  for checking: exec sp_dbcmptlevel 'dbname'
->  for changing: exec sp_dbcmptlevel 'dbname', 7 (or 8 if you have sql 2000)

CHeers



0
 
LVL 3

Author Comment

by:sanjaykattimani
ID: 7137469
* do you mean that the output in Query Analyser get's truncated?

No its being executed inside the procedure and the variable is also declared inside sql procedure.

* is the compatibility of the database eventually set to version 6?
compatibility version is set to 7 [default]

Any more info..?

0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 7137474
Then the problem is probably the code, can you post it (at least those parts that are relevant to assigning the values to the variable).

* do you mean that the output in Query Analyser get's truncated?
> No its being executed inside the procedure and the variable is also declared inside sql procedure.
Ok, but where do you SEE that the value is truncted to 256?

CHeers
0
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 
LVL 3

Author Comment

by:sanjaykattimani
ID: 7137486
:) thanks for instant replies.

Hey its solved. Thanks.
Yes it was query analyser, result was dumped in a table and was being viewed by query analyser.

Thanks again
0
 
LVL 3

Author Comment

by:sanjaykattimani
ID: 7137530
i am getting
Expected ';' in line 1
error in every page. Kindly solve it.

Also i didnt receive any satisfactory answer to my question
http://www.experts-exchange.com/visualbasic/Q_20317813.html
what to do.. delete this... or still i can expect some answer?

0
 
LVL 3

Author Comment

by:sanjaykattimani
ID: 7137531
sorry.... above comment in a wrong place..
0

Featured Post

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
I have a large data set and a SSIS package. How can I load this file in multi threading?
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

947 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now