Reading SQL Server’s IMAGE Data Type
For the “something I always forget and have to search for” bucket: if you have an IMAGE data type in a table, and you want a quick-n-nasty way to read the contents, AND if it’s not more than 8000 characters:
select cast(cast(fieldName as varbinary(8000)) as varchar(8000)) FROM tablename
Told you it was quick, and told you it was nasty
Advertisement
Leave a Comment