0

I've got the following:

remote function Save(Param) {
local.svc = new storedproc();
local.svc.setProcedure("Save"); 
local.svc.addParam(cfsqltype="cf_sql_varchar",type= "in",value='#arguments.Param#');
local.obj = local.svc.execute();
local.result = {};
local.result.msg = local.obj.getprocOutVariables().msg;
return local.result;
}

It looks like the limit as to the size that I can pass up to SQL Server is around 2k.

Q: Is that right, and can I increase it?

Edit:

http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7d52.html

says a maxLength of 0 allows any length, but when I added that, I got an "Invalid data value" error.

James A Mohler
  • 11,060
  • 15
  • 46
  • 72
Phillip Senn
  • 46,771
  • 90
  • 257
  • 373
  • 1
    Not sure where you are getting 2K from, but the real question is what is the exact data type of the parameter within the procedure? That definition is what really determines the capacity. Either a [length of 1 to 8000 - or for varchar(max) the maximum storage of ~2GB](http://technet.microsoft.com/en-us/library/ms176089.aspx). Though for `varchar(max)` the correct cfsqltype is `cf_sql_longvarchar`, not `cf_sql_varchar`. (Edit) Do not use `maxLength`. If you are having a problem with the input, can you give us a specific example? – Leigh Nov 26 '13 at 22:16
  • I found out what the problem was: I got a ListLen function from [ShinyLight.com](http://www.shinylight.com/2010/04/27/tsql-functions-inspired-by-coldfusions-lists-functions/) and it had a Varchar(2000) as it's input parameter. – Phillip Senn Nov 26 '13 at 22:51
  • Yep, for the most part, the variable declaration is really what dictates the limits. BTW, for SQL Server 2005+ you can eliminate a lot of that looping and do some neat stuff w/[xml functions](http://stackoverflow.com/a/19450166/104223). – Leigh Nov 26 '13 at 23:06
  • @Phillip You should add that as an answer to this question so it will be easier for people to see when searching. – Miguel-F Nov 27 '13 at 13:46
  • I regularly variables in that are over 500KB. Just as long as you are loading it into a varchar(max) or xml, It will take it. (Not saying I would recommend it, but it will do it) – James A Mohler Dec 03 '13 at 06:29

0 Answers0