0

Variable Length More Than 8000 Chars

my variable length is exceeding 8000 characters. as we can't use text data type with a local variable and max limit for varchar data type is 8000 so what is the soln for that.

thanks,

user2195726
  • 53
  • 1
  • 4
  • 1
    What version of SQL server? – Charleh Oct 01 '13 at 10:20
  • Need a bit more info about what you are trying to do. But a start would be ReadText and WriteText. Warning it's quite painful. Personally I'd have a serious think about finding something else to do the work. – Tony Hopkinson Oct 01 '13 at 10:21

5 Answers5

2

Use VARCHAR(MAX). It stores a maximum of 2 147 483 647 characters.

huMpty duMpty
  • 14,346
  • 14
  • 60
  • 99
GriGrim
  • 2,891
  • 1
  • 19
  • 33
0

you can use varchar(max) data type

tomsv
  • 7,207
  • 6
  • 55
  • 88
K T
  • 169
  • 1
  • 4
  • 14
0

You can use nvarchar(max) data type.

Amit
  • 15,217
  • 8
  • 46
  • 68
0

You can use VARCHAR(MAX) or TEXT datatypes.But I prefer using VARCHAR(MAX) as TEXT datatype is deprecated.

0

If it is not text that you want to store, use

varbinary(max)
tomsv
  • 7,207
  • 6
  • 55
  • 88