varchar type

  • Hello evrbody,

    I've used to SQL Server 6.5 ...

    I've had some problems...

    I want to make my own SQL procedure which..

    execute dynamicly created sql terms ..

    and sql server message to me ...

    the max size of varchar must be 2555..

    my question ..

    how can I increase max size of varchar type..

  • I believe the limitation in 6.5 for varchar was 255. It increased to 8000 in version 7.0. So you can't explicitly increase the varchar size past the limit.

    K. Brian Kelley

    bk@warpdrivedesign.org

    http://www.sqlservercentral.com/columnists/bkelley/

    K. Brian Kelley
    @kbriankelley

  • Mikascig,

    Just in case you didnt realize, you could change the column to text instead of varchar. Lots of tradeoffs with that choice. Another option would be to store your text in multiple varchar(255) cols or records, then you'd have to handle saving/reading them in a way your app could work with. This is basically what SQL is doing under the hood for you.

    Andy

  • quote:


    Hello evrbody,

    how can I increase max size of varchar type..


    If this is a SQL server 2000 data base that was converted be sure your data base compatiblity is set to 8.0.

  • quote:


    Hello evrbody,

    I've used to SQL Server 6.5 ...

    I've had some problems...

    I want to make my own SQL procedure which..

    execute dynamicly created sql terms ..

    and sql server message to me ...

    the max size of varchar must be 2555..

    my question ..

    how can I increase max size of varchar type..


    The max size for a row in SQL 6.5 is 2K so you cannot have more space than that. Either you will need to upograde to a newer SQL Version or use a datatype of TEXT to get the space you need.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply