Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How to Insert the Images in DB

Author  Topic 

grandhi
Starting Member

31 Posts

Posted - 2013-05-16 : 08:28:46
Hi All,

I want to insert images in table,for that purpose I wrote the following code.


CREATE TABLE ImageTesting(picture Image)
insert into ImageTesting(picture ) values ('C:\Users\Public\Pictures\Sample Pictures\Chrysanthemum.jpg')


after evaluation,I am getting like (1 row(s) affected)

after seeing result,I thought successfully inserted.again for my testing I evaluated The following query.

select * from ImageTesting


it returns,some number format of data.

How can I solve this?

can anyone help me.

Thank you

immad
Posting Yak Master

230 Posts

Posted - 2013-05-16 : 08:56:36

i think the number data that u calling is binary data.

can u show me that number data

immad uddin ahmed
Go to Top of Page

grandhi
Starting Member

31 Posts

Posted - 2013-05-16 : 09:21:11
the number format is following below

433A5C55736572735C5075626C69635C50696374757265735C53616D706C652050696374757265735C4368727973616E7468656D756D2E6A7067
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-05-17 : 00:07:57
you need to use OPENROWSET bulk

see
http://www.java2s.com/Tutorial/SQLServer/0100__Data-Types/InsertingorUpdatinganImageFileUsingOPENROWSETandBULK.htm

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
   

- Advertisement -