Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Store more than 8000 characters in a string using SQL

I want to create one html table with column in SQL Server which having more than 8000 characters. So varchar(Max) store only 8000 so any solution..

like image 366
Dipak Bilade Avatar asked Feb 13 '26 18:02

Dipak Bilade


1 Answers

As said in the comments VARCHAR(MAX) can hold far more characters than your fingertips would allow you to bash out. Bear in mind if you PRINT a VARCHAR(MAX) variable, it will only print out the first 8000 characters (as default), since this is the limit for the PRINT function.

EDIT: Expanding on that, you can pass the character position to PRINT and it will display 8000 characters from that position, so a simple while loop would be sufficient to display the entirety of the variable.

like image 110
John Bell Avatar answered Feb 16 '26 09:02

John Bell



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!