Storing over 8000 characters per string using SQL

I want to create one html table with a column in SQL Server that has over 8000 characters. Therefore varchar(Max)

only stores 8000, so any solution ..

+3


source to share


1 answer


As the comments said, VARCHAR(MAX)

can contain many more characters than your fingertips would let you bash exit. Keep in mind, if you are PRINT

a VARCHAR(MAX)

variable, it will only print the first 8000 characters (the default), as this is the limit for the function PRINT

.



EDIT: By expanding this, you can pass the position of the character in PRINT

and it will display 8000 characters from that position, so a simple while loop is enough to display the entire variable.

+3


source







All Articles