0

I got an SQL Server table column that can store an image in the form of an extra large base64 string value, the thing is that I'm trying to copy the base64 value to check the image in another application but when I copy it, it truncates itself and when I paste the base64 in the other app it shows the half of the image. Maybe something with the type of value that can be stored there?

Also is it happening in other tables that have extra large strings (34k characters or more). The type of value stored in the column is varchar(MAX) and the base64 string is very very large.

Any help is appreciated!

Dale K
  • 25,246
  • 15
  • 42
  • 71
AlfreP25
  • 13
  • 4
  • Have a look at this: https://stackoverflow.com/questions/2759721/how-do-i-view-the-full-content-of-a-text-or-varcharmax-column-in-sql-server-20 – squillman Jun 16 '22 at 19:17
  • Side note: the real question is why you are storing this as base64 in a `varchar`. It should be in a `varbinary(max)` as actual bytes. Not that this helps you to view it in SSMS, but just noting. – Charlieface Jun 16 '22 at 20:11
  • @Charlieface Well yeah, actually I asked this question because my back-end was having problems managing and debugging those extra long strings, but I really appreciate your suggestion and thank you, I'm gonna tell my colleague about it. Does varbinary(max) have any advantage over varchar(max), if so, which ones? – AlfreP25 Jun 16 '22 at 20:44
  • It uses 1/3 less space, because it doesn't have the base64 encoding. Also makes sense to keep bytes as bytes, a `varchar` is only meant for text – Charlieface Jun 16 '22 at 20:46

0 Answers0