Parameter Type/Size Property Values for VARCHAR(MAX) Stored Proc Parameter

Discussion in 'ASP .Net' started by jcpc, Jan 25, 2011.

  1. jcpc

    jcpc Guest

    I have a SQL Server stored proc with a VARCHAR(MAX) output parameter.
    What are the corresponding SqlParameter sqlDbType and size values?
     
    jcpc, Jan 25, 2011
    #1
    1. Advertisements

  2. jcpc

    Arne Vajhøj Guest

    Re: Parameter Type/Size Property Values for VARCHAR(MAX) Stored ProcParameter

    On 25-01-2011 11:23, jcpc wrote:
    > I have a SQL Server stored proc with a VARCHAR(MAX) output parameter.
    > What are the corresponding SqlParameter sqlDbType and size values?


    SqlDbType.VarChar and then either omit the size or specify
    it as -1.

    Arne
     
    Arne Vajhøj, Jan 25, 2011
    #2
    1. Advertisements

  3. jcpc

    jcpc Guest

    Thanks, Arne! I never would have guessed (and haven't found it in any
    documentation) that -1 can be used to imply a "max" value. I had
    tried using a varchar parameter without the size value, but that works
    only if direction = input.
     
    jcpc, Jan 26, 2011
    #3
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Hazzard
    Replies:
    4
    Views:
    3,488
    Hazzard
    Jul 9, 2003
  2. smen
    Replies:
    3
    Views:
    11,546
    Scott Allen
    Jan 9, 2004
  3. luna
    Replies:
    1
    Views:
    14,127
    Kevin Spencer
    Feb 6, 2004
  4. Maziar Aflatoun

    Returning a varchar from a stored procedure

    Maziar Aflatoun, Apr 22, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    15,073
    Maziar Aflatoun
    Apr 22, 2005
  5. David Lozzi
    Replies:
    3
    Views:
    2,281
    David Lozzi
    Jun 1, 2005
  6. iHavAQuestion

    inserting the max colum in the stored proc

    iHavAQuestion, May 13, 2008, in forum: ASP .Net
    Replies:
    5
    Views:
    618
    George Ter-Saakov
    May 13, 2008
  7. Agoston Bejo

    adDate parameter to stored proc.

    Agoston Bejo, Dec 30, 2004, in forum: ASP General
    Replies:
    1
    Views:
    648
    Bob Barrows [MVP]
    Dec 30, 2004
  8. mike
    Replies:
    6
    Views:
    335
    Anthony Jones
    Mar 25, 2007
Loading...