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. Advertising

  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. Advertising

  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. Advertising

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. luna
    Replies:
    1
    Views:
    13,864
    Kevin Spencer
    Feb 6, 2004
  2. Maziar Aflatoun

    Returning a varchar from a stored procedure

    Maziar Aflatoun, Apr 22, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    14,745
    Maziar Aflatoun
    Apr 22, 2005
  3. David Lozzi
    Replies:
    3
    Views:
    1,952
    David Lozzi
    Jun 1, 2005
  4. iHavAQuestion

    inserting the max colum in the stored proc

    iHavAQuestion, May 13, 2008, in forum: ASP .Net
    Replies:
    5
    Views:
    439
    George Ter-Saakov
    May 13, 2008
  5. mike
    Replies:
    6
    Views:
    170
    Anthony Jones
    Mar 25, 2007
Loading...

Share This Page