Solved

varchar variable getting truncated to 256 chars!

Posted on 2002-07-08
6
557 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 143

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 143

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
Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

 
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

Ready to get started with anonymous questions?

It's easy! Check out this step-by-step guide for asking an anonymous question on Experts Exchange.

Question has a verified solution.

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

The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
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
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

630 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