Which SQL data type to store Base64 encoded file?

Well, Base64 is a ASCII encoding, really – so definitely no need for NVARCHAR – and since it’s text, I’d suggest VARCHAR(MAX)

It’s pure text, up to 2 GB (should be enough), and it’s a string-type, so you can use all string functions on it. NVARCHAR does indeed use twice as much storage – always 2 bytes per character – and is totally unnecessary in this case.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)