Solved

varchar variable getting truncated to 256 chars!

Posted on 2002-07-08
6
551 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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

776 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