|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Thursday, June 14, 2012 11:52 PM
Points: 63,
Visits: 257
|
|
how to insert images in to image table through query
i created one table like.. CREATE TABLE [dbo].[image]( [image2] [varbinary](50) NULL, [id] [int] NULL )
GO
i don't know how to insert/retrieve images through query... Please give some example query..
in my system MS SQL SERVER 2008 Enterprise Edition.....
Thanks in advance....
SRIHARI(:~
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Today @ 4:13 AM
Points: 11,
Visits: 858
|
|
Try this
insert into image (image2,id) select Bulkcolumn from openrowset (bulk 'path of image file', single_blob) as picture,1
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: 2 days ago @ 1:32 AM
Points: 136,
Visits: 770
|
|
Hi,
My 2c...
1. I am concerned that varbinary(50) may not be sufficient storage space. 2. Depending on usage, you may want to check out FILESTREAM if you are using sql server 2008.
I cannot verify syntax.
Good luck!
|
|
|
|