Author |
Topic |
harry2ca
Starting Member
2 Posts |
Posted - 2011-07-12 : 14:04:23
|
Hello,A table contains image type data. Actually it is text file. I don't know how to convert it to text and display. The image data size is about 20kb. Please advise.Thanks.Harry |
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2011-07-12 : 14:09:55
|
SELECT CAST(imageColumn as varchar(max)) FROM myTableYou probably can't display all 20K in Management Studio's query results window, but otherwise that will work. |
|
|
Seventhnight
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2011-07-12 : 14:17:48
|
I thought you needed to go through varbinary first... but who knows...Select cast(cast(imageColumn as varbinary(max)) as varchar(max)) From myTableCoreyI Has Returned!! |
|
|
harry2ca
Starting Member
2 Posts |
Posted - 2011-07-12 : 14:33:26
|
Thanks for all replys, expecially Corey.Your solution works for me. Thanks again. :) |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2011-07-12 : 14:33:57
|
Ugh, you're right. Kids, this is what happens when you don't test your code. |
|
|
Seventhnight
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2011-07-12 : 14:54:54
|
Kids are what happens when you don't test your code?? You better be damn sure I'll be testing from now on. I don't need anymore CoreyI Has Returned!! |
|
|
Baldwin
Starting Member
2 Posts |
Posted - 2013-03-25 : 03:10:46
|
if you wanna convert the image to text file, you have to use a image conveting program, for this, according to my experience, you can search in google or bing and you can get many FREE online image converting solution, this is what im using, hope it can solve your problem.unspammed |
|
|
cicorp
Starting Member
1 Post |
Posted - 2013-10-09 : 10:25:52
|
quote: Originally posted by Seventhnight I thought you needed to go through varbinary first... but who knows...Select cast(cast(imageColumn as varbinary(max)) as varchar(max)) From myTable
Thank you Corey. It worked, and saved my data programming contract! |
|
|
Donna111
Starting Member
4 Posts |
Posted - 2013-10-21 : 23:20:57
|
Hi thereI've never tried to unspammed data to text before.I usually covnert image using an image converter.That would help a lot.You can have a try.Best wishes. |
|
|
|