[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Varchar(Max) problems

Posted on 2007-03-26
4
Medium Priority
?
3,098 Views
Last Modified: 2012-06-27
Hello,

I am just embarking on a new project, and we have hit a scenario where we need to store more than 8000 characters in the field. Since we have upgradede to SQL 2005 it seems like the ideal opportunity to use VarChar(MAX).

However, i have read a couple of articles on the web saying that Classic ASP cannot handlle any string longer than 8000 characters and so therefore cannot read a string passed from the database if it exceeds this length. Is this true?

Whilst on the subject, in ASP i would setup my output parameters like so

.Parameters.Append .CreateParameter("@chvBody", adVarChar, adParamOutput, 1000)

However, with a MAX field i dont know the length of the output so, do i still declare the datatype as adVarChar, and what do i put as the length?

Thanks in advance

Al
0
Comment
Question by:higgsy
[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 Comments
 
LVL 8

Accepted Solution

by:
drydenhogg earned 2000 total points
ID: 18793347
You will have a dependency to SQL Native Client for this, VarChar(Max) has native client support, MDAC will not support it. So if your classic ASP can not gone up to SNAC then you do have a problem. When MDAC looks at a SQL 2005 VarChar(Max) it see's a text data type.

You will need to use the adLongVarChar types that used to be used for text, they handle the varchar(max) now within ADO. I have not seen the value you would use for the parameter length, in theory 2,147,483,647 is the max length of it (2^32 -1)

http://msdn2.microsoft.com/en-us/library/ms130978.aspx

hth
0
 
LVL 29

Expert Comment

by:rdivilbiss
ID: 18793542
>>what do i put as the length?

CLng(Len(your_actual_fields))

>>variables in Classic ASP are of type variant so a string variant can hold a variable-length string that can be up to approximately 2 billion characters in length. (from the VBScript / ASP documentation)

0
 
LVL 9

Expert Comment

by:fuzzboxer
ID: 18819887
You could try using the "text" data type.  It has a max length of 2^31.  That would be over 2 million.
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 18820142
>>You could try using the "text" data type. <<
The text data type is a deprecated data type, the questioner is better off using varchar(MAX)
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

656 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