Skip to main content
October 1, 2010
Question

what will be the maxlenght attribute in cfqueryparam when column in Varchar(max)

  • October 1, 2010
  • 1 reply
  • 843 views

Hi,

what will be the maxlenght attribute in cfqueryparam when column in Varchar(max).

maxlength="8000" is right or not?

Please anyone correct me i am wrong..

    This topic has been closed for replies.

    1 reply

    Inspiring
    October 1, 2010

    Whatever the DB defines the size of varchar(max) to be.  There is no special code you can provide to say "the biggest size", although you don't need to specify a on a <cfqueryparam> tag, and this is probably a good situation where you oughtn't.

    --

    Adam

    Inspiring
    October 1, 2010

    I agree with Adam that you can usually omit maxlength if you working with the  varchar(max) data type.  You will also want to use "CF_SQL_LONGVARCHAR"  as the value for cfsqltype in your CFQUERYPARAM tag for a varchar(max)  database field.