Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

varchar variable getting truncated to 256 chars!

Posted on 2002-07-08
6
Medium Priority
?
560 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 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 400 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
Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

 
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

[Webinar] Cloud Security

In this webinar you will learn:

-Why existing firewall and DMZ architectures are not suited for securing cloud applications
-How to make your enterprise “Cloud Ready”, and fix your aging DMZ architecture
-How to transform your enterprise and become a Cloud Enabler

Question has a verified solution.

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

I have a large data set and a SSIS package. How can I load this file in multi threading?
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
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.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

971 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