I have an old SQL Server database where there are files stored with the datatype text.
For example a .jpg image looks like this
89504E470D0A1A0A0000000D4948445200000A80000005F00806000000788B1B29000000017352474200AECE1CE90000000467414D410000B18F0BFC6105000000097048597300000EC300000.........
I'm guessing that this is binary?
How can I extract these to files?
I've tried various methods for extracting but failed which I'm guessing is due to the datatype being text and not blob or varbinary.
select convert(varbinary(max), cast(cast('89504E470D0A1A0A00' as text) as varchar(max)), 2)