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,061
  • 13
  • 55
  • 93
GriGrim
  • 2,742
  • 1
  • 17
  • 31
0

you can use varchar(max) data type

tomsv
  • 7,017
  • 5
  • 52
  • 87
K T
  • 155
  • 1
  • 4
  • 14
0

You can use nvarchar(max) data type.

Amit
  • 15,021
  • 8
  • 44
  • 66
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,017
  • 5
  • 52
  • 87